vladkens / twscrape

2024! X / Twitter API scrapper with authorization support. Allows you to scrape search results, User's profiles (followers/following), Tweets (favoriters/retweeters) and more.
https://pypi.org/project/twscrape/
MIT License
1.12k stars 133 forks source link

Any way to get newest Following first? #164

Closed takabinance closed 2 months ago

takabinance commented 7 months ago

In the Twitter UI, it lists the newest following accounts first. In twscrape, it lists them in some other order. I am trying to efficiently track new followings for a user so I was thinking of just getting the most recent page rather than having to reload all following each time. So the Twitter UI version is preferable for me.

In api.py, there is: OP_Following = "PAnE9toEjRfE-4tozRcsfw/Following"

When I look at what Twitter sends (I think), it uses "fV5QhxlYguIHPeHF3SKaqQ/Following".

Like a monkey I just tried swapping that into api.py and it complained about missing features. Realizing I have no idea what I'm doing, is there any way to get the recency-sorted results for Following?

FWIW, this is what I got back when trying to use that other code for following: [DEV] Update required: (336) The following features cannot be null: tweet_with_visibility_results_prefer_gql_media_interstitial_enabled, rweb_tipjar_consumption_enabled, creator_subscriptions_quote_tweet_preview_enabled, communities_web_enable_tweet_community_results_fetch

And what I saw in console that Twitter sends: https://twitter.com/i/api/graphql/fV5QhxlYguIHPeHF3SKaqQ/Following?variables=%7B%22userId%22%3A%22226749344%22%2C%22count%22%3A20%2C%22includePromotedContent%22%3Afalse%7D&features=%7B%22rweb_tipjar_consumption_enabled%22%3Afalse%2C%22responsive_web_graphql_exclude_directive_enabled%22%3Atrue%2C%22verified_phone_label_enabled%22%3Afalse%2C%22creator_subscriptions_tweet_preview_api_enabled%22%3Atrue%2C%22responsive_web_graphql_timeline_navigation_enabled%22%3Atrue%2C%22responsive_web_graphql_skip_user_profile_image_extensions_enabled%22%3Afalse%2C%22communities_web_enable_tweet_community_results_fetch%22%3Atrue%2C%22c9s_tweet_anatomy_moderator_badge_enabled%22%3Atrue%2C%22tweetypie_unmention_optimization_enabled%22%3Atrue%2C%22responsive_web_edit_tweet_api_enabled%22%3Atrue%2C%22graphql_is_translatable_rweb_tweet_is_translatable_enabled%22%3Atrue%2C%22view_counts_everywhere_api_enabled%22%3Atrue%2C%22longform_notetweets_consumption_enabled%22%3Atrue%2C%22responsive_web_twitter_article_tweet_consumption_enabled%22%3Atrue%2C%22tweet_awards_web_tipping_enabled%22%3Afalse%2C%22creator_subscriptions_quote_tweet_preview_enabled%22%3Afalse%2C%22freedom_of_speech_not_reach_fetch_enabled%22%3Atrue%2C%22standardized_nudges_misinfo%22%3Atrue%2C%22tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled%22%3Atrue%2C%22tweet_with_visibility_results_prefer_gql_media_interstitial_enabled%22%3Afalse%2C%22rweb_video_timestamps_enabled%22%3Atrue%2C%22longform_notetweets_rich_text_read_enabled%22%3Atrue%2C%22longform_notetweets_inline_media_enabled%22%3Atrue%2C%22responsive_web_enhance_cards_enabled%22%3Afalse%7D

mokoshalb commented 7 months ago

Update the feature list.

dedjaa commented 6 months ago

Hey @takabinance did you find a way to get the new followers first ?

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 2 months ago

This issue was closed because it has been stalled for 5 days with no activity.