How to find a retweet account with Twitter4J?

As the title says, I am using the Twitter4J API and I cannot find how to read the retweets of the Tweet instance.

+6
source share
2 answers

The StatusMethodsAsync interface has a getRetweets() function (as described here ), but this only shows the top 100 retweets of the given tweet. If you know that there are less than 100 retweets, this should work. If there is even more in the TwitterStream interface, then there is a stream of all retweets (as described here ), but this does not seem to be fully functional, so I would not know then ...

But it can lead you to the right path.

+2
source

There is no special counting function, but getRetweetedByIDs will provide you with an array of 100 user IDs that renamed the tweet. This is a bit easier if all you need is the number of retweets. The IDs interface also supports the cursor if you need to get more than 100, but I have no experience using these functions.

+1
source

Source: https://habr.com/ru/post/890167/


All Articles