How to get popular tweets from a user with tweepy?

隐身守侯 提交于 2019-12-24 11:27:12

问题


I am trying to get popular tweets from a specific user with tweepy. I need something like result_type = 'popular' from the twitter API (https://dev.twitter.com/rest/reference/get/search/tweets).

How can I do that?


回答1:


With Python, try this to get 5 popular tweets with tag #yoursearch :

for tweet in tweepy.Cursor(api.search, q='#yoursearch',result_type='popular').items(5):
    print(tweet)


来源:https://stackoverflow.com/questions/31903741/how-to-get-popular-tweets-from-a-user-with-tweepy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!