Rishikant181 / Rettiwt-API

A CLI tool and an API for fetching data from Twitter for free!
https://rishikant181.github.io/Rettiwt-API/
MIT License
305 stars 31 forks source link

tweet.retweeters() repeating cursors #445

Open qru23 opened 5 months ago

qru23 commented 5 months ago

There seems to be an issue with cursors repeating after pagination. This seems to be true for every tweet that has more than the limit set by the request.

Instead of returning an empty value when no next results, it instead returns the previous cursor, making the last request repeat infinitely.

An obvious short term solution is to check for a repeating cursor and stop iterating on that, but im not sure if there are any deeper issues involved.

Rishikant181 commented 5 months ago

Instead of returning an empty value when no next results, it instead returns the previous cursor, making the last request repeat infinitely.

Unfortunately, that's how the Twitter Web API works.

An obvious short term solution is to check for a repeating cursor and stop iterating on that

Seems like a viable solutions, on it.

Rishikant181 commented 5 months ago

Currently, the way to check if the results have been exhausted is by checking if length of list field of the response is zero or not. If it's zero, then results have been exhausted. But yeah, a no cursor might have been better.