From 158710df8d5570d0c7f943fd15d1667b0cc30394 Mon Sep 17 00:00:00 2001 From: Alessio Date: Fri, 22 Mar 2024 21:39:13 -0700 Subject: [PATCH] Update User Feed graphql endpoint so it can get long tweets --- pkg/scraper/api_types_v2.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pkg/scraper/api_types_v2.go b/pkg/scraper/api_types_v2.go index 725389f..13f2666 100644 --- a/pkg/scraper/api_types_v2.go +++ b/pkg/scraper/api_types_v2.go @@ -895,7 +895,7 @@ func (api *API) GetPaginatedQuery(pq PaginatedQuery, count int) (TweetTrove, err // Get a User feed using the new GraphQL twitter api func (api *API) GetGraphqlFeedFor(user_id UserID, cursor string) (APIV2Response, error) { url, err := url.Parse(GraphqlURL{ - BaseUrl: "https://twitter.com/i/api/graphql/CwLU7qTfeu0doqhSr6tW4A/UserTweetsAndReplies", + BaseUrl: "https://twitter.com/i/api/graphql/Q6aAvPw7azXZbqXzuqTALA/UserTweetsAndReplies", Variables: GraphqlVariables{ UserID: user_id, Count: 40, @@ -910,7 +910,21 @@ func (api *API) GetGraphqlFeedFor(user_id UserID, cursor string) (APIV2Response, WithSuperFollowsTweetFields: true, WithBirdwatchNotes: false, WithVoice: true, - WithV2Timeline: false, + WithV2Timeline: true, + }, + Features: GraphqlFeatures{ + ResponsiveWebGraphqlExcludeDirectiveEnabled: true, + CreatorSubscriptionsTweetPreviewApiEnabled: true, + ResponsiveWebGraphqlTimelineNavigationEnabled: true, + ResponsiveWebGraphqlSkipUserProfileImageExtensionsEnabled: true, + ResponsiveWebEditTweetApiEnabled: true, + LongformNotetweetsConsumptionEnabled: true, + FreedomOfSpeechNotReachFetchEnabled: false, + TweetWithVisibilityResultsPreferGqlLimitedActionsPolicyEnabled: true, + LongformNotetweetsRichTextReadEnabled: true, + LongformNotetweetsInlineMediaEnabled: false, + ResponsiveWebMediaDownloadVideoEnabled: true, + ResponsiveWebEnhanceCardsEnabled: true, }, }.String()) if err != nil {