Remove UpdateQueryCursor helper function as it was inlined
This commit is contained in:
parent
fe57763568
commit
ec6ecb39cb
@ -234,15 +234,6 @@ func (api API) GetMoreReplies(tweet_id TweetID, response *TweetResponse, max_rep
|
|||||||
return nil
|
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) {
|
func (api API) GetUser(handle UserHandle) (APIUser, error) {
|
||||||
// TODO: break up this URL into params so it's readable
|
// 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" +
|
url, err := url.Parse("https://api.twitter.com/graphql/4S2ihIKfF3xhp-ENxvUAfQ/UserByScreenName?variables=%7B%22screen_name%22%3A%22" +
|
||||||
|
@ -430,7 +430,9 @@ func (api API) GetGraphqlFeedFor(user_id UserID, cursor string) (APIV2Response,
|
|||||||
req.Header.Set("X-Guest-Token", guestToken)
|
req.Header.Set("X-Guest-Token", guestToken)
|
||||||
|
|
||||||
if cursor != "" {
|
if cursor != "" {
|
||||||
UpdateQueryCursor(req, cursor, false)
|
query := req.URL.Query()
|
||||||
|
query.Add("cursor", cursor)
|
||||||
|
req.URL.RawQuery = query.Encode()
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := client.Do(req)
|
resp, err := client.Do(req)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user