redouane59/twittered

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

gagaball88 opened this issue · 1 comments

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.

That's it :)