twitter-scraper icon indicating copy to clipboard operation
twitter-scraper copied to clipboard

Thousands of missing tweets

Open Tarrgon opened this issue 1 year ago • 3 comments

I'm unsure if I'm using this tool wrong, but I'm trying to fetch basically every tweet from a user. When I do this, though, I'm only getting 829 tweets, of their 42,000. Added logs to the module directly showing that getTweetTimeline has an empty array tweets that breaks out of the function.

Is there any way to get more tweets than this?

For reference, here's the code:

for await (let tweet of twitterScraper.getTweets(identifier, Number.MAX_SAFE_INTEGER)) {
   // ...
}

There's no exhausted auth or anything, just runs out of tweets for seemingly no reason.

Tarrgon avatar Jun 19 '24 01:06 Tarrgon

I should add that

tweets = twitterScraper.searchTweets(`(from:${identifier})`, Number.MAX_SAFE_INTEGER, SearchMode.Latest)

seems to go past 1000 just fine.

Tarrgon avatar Jun 19 '24 01:06 Tarrgon

I should add that

tweets = twitterScraper.searchTweets(`(from:${identifier})`, Number.MAX_SAFE_INTEGER, SearchMode.Latest)

seems to go past 1000 just fine.

However, sometimes it just doesn't fetch everything for some reason, but probably something to do with the times when it just doesn't load

Tarrgon avatar Jun 20 '24 01:06 Tarrgon

It seems that Twitter/X cuts off timelines like those after a certain (unknown?) point. We can abuse the search API to get tweets from someone, but note that it doesn't include retweets. See here: https://socialdata.gitbook.io/docs/twitter-tweets/retrieve-search-results-by-keyword#using-search-operators

catdevnull avatar Jul 07 '24 19:07 catdevnull