python - Tweepy: Handle RateLimit in show_friendship() -


i'm trying see several friendships between 2 twitter users, , i'm using show_friendship(twitter_id_1, twitter_id_2) method tweepy library inside loop.

i wonder how can handle ratelimit or using cursor (http://docs.tweepy.org/en/v3.5.0/cursor_tutorial.html) method because after several loops raises ratelimiterror.

this ratelimit handle of search friends (people i'm following) can't figure out how same show_friendship()

def limit_handled(self, cursor):     while true:         try:             yield cursor.next()         except tweepy.ratelimiterror:             time.sleep(15 * 60)   friend in limit_handled(tweepy.cursor(api.friends).items()):       #stuff 


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -