Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.
Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.
TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am using the V2 reecent tweets search endpoint.
I am using the easier method as described in the V2 documentation on GitHub, using
collect_results
.The problem is as follows. I am trying to loop the whole code through a list of keywords, with the number of tweets for each keyword specific in a dictionary for each keyword that need to be pulled. All of them are below the limit fo 450 requests per 15 min.
Now, I have narrowed down the problem to the following.
In the method as follows:
In the following collect_results method:
If I give an integer value to
max_tweets
, such asmax_tweets = 45000
, it works fine…but if I writemax_tweets = num
andnum = 45000
or whatever the value that corresponds to the keyword currently in the loop, the rate limit is hit. The API call does not stop when max_tweets have been reached (if I pass a variable to it). But if I pass an integer directly, the function runs fine.I have checked the value of num and it is indeed 45k just before being passed to max_tweets, the limit does not apply and rate limit is hit.
Very weird behavior. Anyone got some clues as to this behavior?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions