2017-02-01 59 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 

如何,我可以得到一個用戶的所有時間表?

回答

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_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.