From 8a41a9f506750d7222de0b5eb842ba1d09f3f9e1 Mon Sep 17 00:00:00 2001 From: Svilen Markov <7613769+svilenmarkov@users.noreply.github.com> Date: Thu, 17 Oct 2024 21:36:22 +0100 Subject: [PATCH] Improve formatting of request body --- internal/feed/twitch.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/feed/twitch.go b/internal/feed/twitch.go index 739d7d1..d04afc1 100644 --- a/internal/feed/twitch.go +++ b/internal/feed/twitch.go @@ -142,7 +142,10 @@ func FetchTopGamesFromTwitch(exclude []string, limit int) ([]TwitchCategory, err return categories, nil } -const twitchChannelStatusOperationRequestBody = `[{"operationName":"ChannelShell","variables":{"login":"%s"},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"580ab410bcd0c1ad194224957ae2241e5d252b2c5173d8e0cce9d32d5bb14efe"}}},{"operationName":"StreamMetadata","variables":{"channelLogin":"%s"},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"676ee2f834ede42eb4514cdb432b3134fefc12590080c9a2c9bb44a2a4a63266"}}}]` +const twitchChannelStatusOperationRequestBody = `[ +{"operationName":"ChannelShell","variables":{"login":"%s"},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"580ab410bcd0c1ad194224957ae2241e5d252b2c5173d8e0cce9d32d5bb14efe"}}}, +{"operationName":"StreamMetadata","variables":{"channelLogin":"%s"},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"676ee2f834ede42eb4514cdb432b3134fefc12590080c9a2c9bb44a2a4a63266"}}} +]` // TODO: rework // The operations for multiple channels can all be sent in a single request