def get_following_id (user_keys,api,user,f_log,flag_fast):
dict_following={}
try:
print 'get %s ids followers' % user
for page in tweepy.Cursor(api.friends_ids,screen_name=user,
monitor_rate_limit=True,
wait_on_rate_limit=True,
wait_on_rate_limit_notify = True,
retry_count = 5,
retry_delay = 5 ).pages():
for following_id in page:
dict_following[following_id]=1
if flag_fast:
return dict_following
except:
f_log.write(('%s, %s error en tweepy, method friends/id, user %s\n') % (time.asctime(),TypeError(),user))
return dict_following
评论列表
文章目录