public class SearchPagination
extends Object
Searched tweets are ordered from top to bottom by their IDs. The higher the ID, more recent the tweet is.
The search goes backwards - from most recent to the oldest tweets and it uses the sinceId and the maxId to retrieve
only tweets with IDs in the [sinceId, maxId) range. The -1 stands for unbounded sinceId or maxId.
The first `pageCount` number requests are performed backwards, leaving the bottom boundary (sinceId) unbounded and
adjusting the upper boundary (maxId) to the lowest tweet ID received. This ensures that no already processed
tweets are returned.
The pageCounter is used the to count the number of pages retrieved in the pageCount range. Is starts from pageCount
and goes backward until 0. On 0 the pageCounter is reset back to pageCount.
After performing pageCount number requests (e.g. pageCounter = 0), we start new iteration of searches from the top,
most recent tweets but now the bottom boundary (sinceId) is adjusted to the max ID received so far. That means that
only the newly added tweets will be processed
Search pagination with max_id and since_id: https://developer.twitter.com/en/docs/tweets/timelines/guides/working-with-timelines.html
- Author:
- Christian Tzolov