我正在使用python-twitter库,但我无法获得指定用户的所有时间轴。
api = twitter.Api(consumer_key='',
consumer_secret='',
access_token_key='',
access_token_secret='')
statuses = api.GetUserTimeline(screen_name = "me", count = 2000)
print len(statues)
总是返回:
200
如何获得一位用户的所有时间表?
答案 0 :(得分:0)
来自python-twitter
api源代码https://github.com/bear/python-twitter/blob/master/twitter/api.py:
count (int, optional):
Specifies the number of statuses to retrieve. May not be
greater than 200.
您只能通过一个请求获得超过200条推文。
这样你可以检索最后200条推文。如果您想获得较旧的推文,则必须使用since_id
和max_id
参数。
since_id (int, optional):
Returns results with an ID greater than (that is, more recent
than) the specified ID. There are limits to the number of
Tweets which can be accessed through the API. If the limit of
Tweets has occurred since the since_id, the since_id will be
forced to the oldest ID available.
max_id (int, optional):
Returns only statuses with an ID less than (that is, older
than) or equal to the specified ID.