redouane59 / twittered

Twitter API client for Java developers
Apache License 2.0
235 stars 64 forks source link

How do I limit amount of tweets pulled when getting a user's timeline? #361

Closed gagaball88 closed 2 years ago

gagaball88 commented 2 years ago

I'm trying to pull tweets of users at a regular interval with:

twitterClient.getUserTimeline(database.id, AdditionalParameters.builder().maxResults(10).build()).getData()

I thought that the AdditionalParameters.builder().maxResults(10).build() part would limit the tweets pulled to the latest 10, but with every execution, it pulls ALL tweets ever from the user.

Am I doing something wrong? How do I just get the latest 10 tweets?

Edit:

I think I just found what I'm looking for,

twitterClient.getUserTimeline(database.id, AdditionalParameters.builder().recursiveCall(false).maxResults(10).build()).getData());

seems to be working.

redouane59 commented 2 years ago

That's it :)