Getting the tweets with highest number of likes, retweets and comments

Viewed 760

I trying to use tweepy to filter top 10 users by the highest number of likes, retweets, and comments.

I tried using this

for tweet in tweepy.Cursor(api.search, q='#27DecBlackDay',result_type='popular').items(10):
    print(tweet.text)

Rather than filtering out the most popular top 10 tweets. It gives mostly less than 10 and for some searches, it does not even return anything.

I don't understand what I am doing wrong. Any help will be appreciated.

1 Answers

It gives mostly less than 10 and for some searches, it does not even return anything.

.items(10 in this case represents an upper-bound not a must-have value. The requested count of ten items is the maximum of values that will be returned, not the minimum.

You aren't able to do anything in this case as it's outside of the library scope and influenced by many factors - most often due to Twitter's limits.


I highly suggest to check a few of the following sources for further reading purposes:

Related