Guest User

Untitled

a guest
Sep 29th, 2016
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. api = tw_oauth('./auth.k')
  2. coursor = tweepy.Cursor(api.search, q='site.ru', count = 20)
  3. for tweet in coursor.items():
  4. ...
  5.  
  6. def limit_handled(cursor):
  7. while True:
  8. try:
  9. yield cursor.next()
  10. except tweepy.RateLimitError:
  11. time.sleep(15 * 60)
  12.  
  13. for tweet in limit_handled(tweepy.Cursor(api.search, q='site.ru', count = 20).items()):
  14. print (tweet.id)
Add Comment
Please, Sign In to add comment