daily pastebin goal
62%
SHARE
TWEET

limit_handled()

WilliamWelna Mar 13th, 2018 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. def limit_handled(cursor):
  3.     while True:
  4.         try:
  5.             time.sleep(0.5)
  6.             yield cursor.next()
  7.         except tweepy.RateLimitError:
  8.             print "Waiting a few minutes..."
  9.             time.sleep(16 * 60)
  10.         except tweepy.TweepError as e:
  11.             print "Got a Error->"+e.reason
  12.             time.sleep(30)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top