Workaround a limitation in the Twitter API returning empty page
Workaround a limitation in the Twitter API returning empty page

In some cases, the Twitter API will return an empty page of results
from the counts API, without a next_token for pagination and only
a meta.tweet_count value of 0. This happens even when more results
should definitely happen.

This adds a workaround for this, by detecting when the query has
terminated early based on the start-time provided, and restarting
the counts call with the last seen start-time as the new end-time.

Hopefully we will get confirmation from Twitter that this is a bug
and will be able to remove this workaround.

DocNow/twarc