【发布时间】:2013-06-13 21:11:47
【问题描述】:
我需要打印转发推文的用户的 ID。当我运行我的代码时,这就是我得到的。我做错了什么?
请求()
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
Traceback(最近一次调用最后一次): 文件“”,第 1 行,在 请求() 文件“C:\Documents and Settings\visolink\Desktop\Python\programs\twitter_travel_guard.py”,第 136 行,在 reqs 转推 = t.statuses.retweets_of_me(since_id=str(tweet['id']), max_id=str(tweet['id'])) 调用中的文件“C:\Documents and Settings\visolink\Desktop\Python\programs\twitter\api.py”,第 204 行 return self._handle_response(req, uri, arg_data, _timeout) _handle_response 中的文件“C:\Documents and Settings\visolink\Desktop\Python\programs\twitter\api.py”,第 235 行 引发 TwitterHTTPError(e, uri, self.format, arg_data) TwitterHTTPError:Twitter的发送状态429为URL:1.1 /状态/ retweets_of_me.json使用参数:(max_id = 345206977242210304&oauth_consumer_key = ...&oauth_nonce = ...&oauth_signature_method = ...&oauth_timestamp = 1371498240&组oauth_token = ...&oauth_version = 1.0&since_id = 345206977242210304&oauth_signature =m...) 详细信息:{“错误”:[{“消息”:“超出速率限制”,“代码”:88}]}
代码:
def reqs():
t = Twitter(auth=OAuth('....'))
tweets = t.statuses.user_timeline.TravelGuard()
for tweet in tweets:
retweets = t.statuses.retweets_of_me(since_id=str(tweet['id']), max_id=str(tweet['id']))
print retweets
【问题讨论】:
标签: python api twitter compiler-errors tweets