2014-02-09 274 views
0

嗨,也許我錯過了一些非常明顯的東西,但我一直在使用tweepy從關鍵字收集推文。Tweet的詳細信息

我無法理解,並且一直在搜索大部分時間,如何訪問我擁有的推文的詳細信息,例如他們的推特計數或最喜歡的計數。這使用推文的身份證號碼。

任何幫助,以做到這一點將是非常有益的。

回答

0
import tweepy 


consumer_key="" 
consumer_secret="" 
access_key = "" 
access_secret = "" 


auth = tweepy.OAuthHandler(consumer_key, consumer_secret) 
auth.set_access_token(access_key, access_secret) 
api = tweepy.API(auth) 

id_list = ['tweetidexample', 'tweetidexample',"....etc" ] 

def get_retweet_count(tweet_id): 
    tweet = api.get_status(tweet_id) 
    return tweet.retweet_count 

for id in id_list: 
    print get_retweet_count(id), id 

這使得至少可以通過ID進行轉推計數。

0

您可以通過刮網站通過api.get_status使用statuses/show終點(在Tweepy可不幸的是,不是由端點提供的任何數據,纔可以訪問。 - 有沒有辦法擁有Twitter發送更多的數據