2017-02-01 5 views
1

私はpython-twitterライブラリを使用していますが、指定したユーザーのタイムラインをすべて取得できません。GetUserTimelineはすべてのタイムラインを返すことができません

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 

を私は1人のユーザーのすべてのタイムラインを取得できますか?

答えて

0

https://github.com/bear/python-twitter/blob/master/twitter/api.py APIのソースコードpython-twitterから:

 count (int, optional): 
     Specifies the number of statuses to retrieve. May not be 
     greater than 200. 

あなたは一つのリクエストで200件の以上のつぶやきを取得することはできません。

この方法で、最後の200個のつぶやきを取得します。あなたが古いツイートを取得したい場合は、since_idmax_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. 
関連する問題