Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_tweets returns 0 tweets when replies=True with cursor #170

Open
hauselin opened this issue Feb 26, 2024 · 4 comments
Open

get_tweets returns 0 tweets when replies=True with cursor #170

hauselin opened this issue Feb 26, 2024 · 4 comments

Comments

@hauselin
Copy link

I'm using get_tweets and have already retrieved many pages of tweets, and I'm using cursors. But at some point, after retrieving hundreds of pages, it starts returning 0 tweets, but only when replies=True (see cursor_pages900 below). Any reason why that might be happening? Thanks!

from tweety import Twitter
app = Twitter("session")
app.sign_in(username, password)

user = "elonmusk"

# cursor from getting just 1 page of tweets: get_tweets(pages=1)
cursor_page001 = "DAABCgABGHOu41v__-QKAAIYc06G79Yg4AgAAwAAAAIAAA"  
# cursor from getting more than 900 pages of tweets
cursor_page900 = "DAABCgABGG3fhij_8VYKAAIYGUieVhahQQgAAwAAAAIAAA" 

tweets_replies = app.get_tweets(user, replies=False, cursor=cursor_page001)
# UserTweets(user_id=44196397, count=18)
tweets_replies = app.get_tweets(user, replies=True, cursor=cursor_page001)
# UserTweets(user_id=44196397, count=20)

tweets_replies = app.get_tweets(user, replies=False, cursor=cursor_page900)
# UserTweets(user_id=44196397, count=19)
tweets_replies = app.get_tweets(user, replies=True, cursor=cursor_page900)
# UserTweets(user_id=44196397, count=0)  why 0 tweets retrieved???
@mahrtayyab
Copy link
Owner

  1. Same Cursor can't be used for 'with_replies' and 'without_replies'
  2. https://github.com/mahrtayyab/tweety/wiki/FAQs#twitter-new-limits

@hauselin
Copy link
Author

Thanks! Regarding the second point, are you referring to this: "Tweets of a User can be fetched of last 7-10 days only, for going beyond that use Search method." Also, does the search method return all tweets or just a (random) subset of matching tweets?

@mahrtayyab
Copy link
Owner

Thanks! Regarding the second point, are you referring to this: "Tweets of a User can be fetched of last 7-10 days only, for going beyond that use Search method." Also, does the search method return all tweets or just a (random) subset of matching tweets?

Using advance search will give you tweets only for that query

@hauselin
Copy link
Author

Will give that a shot. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants