我有一個腳本編寫來遍歷Twitter用戶標識列表,並將follower_id列表保存到文件中。我已經多次使用它,沒有任何問題。當我進行GET調用時,get_rate_status「剩餘命中數」不會減少
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 < 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
我有這樣的Oauth Blurb的設置在頂部:對於長的列表,如果我要進行速率限制我加入這一段代碼來檢查率限制之前每個GET請求和睡眠
auth = tweepy.OAuthHandler('xxxx', 'xxxx')
auth.set_access_token('xxxx', 'xxxxx')
api = tweepy.API(auth)
我多次打出電話是:腳本
follower_cursors = tweepy.Cursor(api.followers_ids)
所以,現在,不管我有多少電話讓我的「剩餘命中」保持在150至Twitter的返回「超出限制速度客戶每小時可能不會發出超過350個請求。「
看起來速率限制檢查器報告我未經授權的IP地址的速率限制(150),但我的通話數量正在計算我的應用的速率限制(350)。
如何調整速率限制檢查器以再次檢查應用的速率限制?