Skip to content

Commit

Permalink
Fixing Twitter chaotic responses
Browse files Browse the repository at this point in the history
  • Loading branch information
Yomguithereal committed Sep 10, 2021
1 parent 29bbad6 commit 08e1ba6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion minet/twitter/api_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,10 @@ def search(self, query, limit=None, before_sleep=None,
if limit is not None and i >= limit:
return

if new_cursor is None or len(tweets) == 0:
# NOTE: we cannot stop when no tweets are found anymore because
# of Twitter's public facing API's strange hiccups.
# Comparing cursors seems to be the only good option now...
if new_cursor is None or new_cursor == cursor:
return

cursor = new_cursor

0 comments on commit 08e1ba6

Please sign in to comment.