Note that there are some explanatory texts on larger screens.

plurals
  1. POget_rate_status "remaining hits" does not decrease when I make GET calls anymore
    primarykey
    data
    text
    <p>I have a script written to iterate through a list of Twitter userIDs and save the lists of follower_ids to a file. I have used it several times with no problems. For long lists, I have added this piece of code to check the rate limit before every GET request and sleep if I'm about to be rate-limited:</p> <pre><code>rate_limit_json = api.rate_limit_status() remaining_hits = rate_limit_json["remaining_hits"] print 'you have', remaining_hits, 'API calls remaining until next hour' if remaining_hits &lt; 2: dtcode = datetime.utcnow() unixtime = calendar.timegm(dtcode.utctimetuple()) sleeptime = rate_limit_json['reset_time_in_seconds'] - unixtime + 10 print 'waiting ', sleeptime, 'seconds' time.sleep(sleeptime) else: pass </code></pre> <p>I have this Oauth blurb set up at the top of the script:</p> <pre><code>auth = tweepy.OAuthHandler('xxxx', 'xxxx') auth.set_access_token('xxxx', 'xxxxx') api = tweepy.API(auth) </code></pre> <p>The call I'm repeatedly making is:</p> <pre><code>follower_cursors = tweepy.Cursor(api.followers_ids) </code></pre> <p>So now, no matter how many calls I make, my "remaining hits" stays at 150 until Twitter returns a "Rate limit exceeded. Clients may not make more than 350 requests per hour."</p> <p>It seems like the rate limit checker is reporting my unauthorized, IP address's rate limit (150), but my calls are counting against my app's rate limit (350).</p> <p>How can I adjust my rate limit checker to actually check the app's rate limit again?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload