Remove UpdateQueryCursor helper function as it was inlined

This commit is contained in:
Alessio 2022-12-10 12:18:52 -05:00
parent fe57763568
commit ec6ecb39cb
2 changed files with 3 additions and 10 deletions

View File

@ -234,15 +234,6 @@ func (api API) GetMoreReplies(tweet_id TweetID, response *TweetResponse, max_rep
return nil
}
func UpdateQueryCursor(req *http.Request, new_cursor string, is_tweet bool) {
query := req.URL.Query()
query.Add("cursor", new_cursor)
if is_tweet {
query.Add("referrer", "tweet")
}
req.URL.RawQuery = query.Encode()
}
func (api API) GetUser(handle UserHandle) (APIUser, error) {
// TODO: break up this URL into params so it's readable
url, err := url.Parse("https://api.twitter.com/graphql/4S2ihIKfF3xhp-ENxvUAfQ/UserByScreenName?variables=%7B%22screen_name%22%3A%22" +

View File

@ -430,7 +430,9 @@ func (api API) GetGraphqlFeedFor(user_id UserID, cursor string) (APIV2Response,
req.Header.Set("X-Guest-Token", guestToken)
if cursor != "" {
UpdateQueryCursor(req, cursor, false)
query := req.URL.Query()
query.Add("cursor", cursor)
req.URL.RawQuery = query.Encode()
}
resp, err := client.Do(req)