Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the number of likes on a tweet via tweepy?

I have a tweepy tweet object and I can see and print its favorite_count and retweet_count but I do not see a like_count when I print the member variables of the object. Knowing the number of favorites seems a lot less relevant for typical use cases of working with a tweet as it is far more common to like something on Twitter than to favorite it.

I am able to do something like this:

api = tweepy.API(auth)
tweet = api.get_status(tweet_id)
print(tweet.retweet_count)
print(tweet.favorite_count)

but doing

print(tweet.like_count)

Does not work and I can't see any alternative. Furthermore when I google things like "tweepy get like count of a tweet" nothing relevant pops up which just seems odd. How can I do this?

like image 411
sometimesiwritecode Avatar asked Aug 18 '17 16:08

sometimesiwritecode


People also ask

How do you see how many likes a tweet has?

To find the total number of likes of any tweet, click or tap on the tweet. Under the tweet text, you'll see a number next to a heart icon. That number represents the number of likes the tweet received.

How do I track my likes on Twitter?

Likes are represented by a small heart and are used to show appreciation for a Tweet. You can view the Tweets you've liked from your profile page by clicking or tapping into the Likes tab.

How do I extract data from Twitter using Tweepy?

– For access token, click ” Create my access token”. The page will refresh and generate access token. Tweepy is one of the library that should be installed using pip. Now in order to authorize our app to access Twitter on our behalf, we need to use the OAuth Interface.

How can I get more than 100 tweets on Tweepy?

If you need more than 100 Tweets, you have to use the paginator method and specify the limit i.e. the total number of Tweets that you want. Replace limit=1000 with the maximum number of tweets you want. Replace the limit=1000 with the maximum number of tweets you want (gist).


Video Answer


1 Answers

Favourites are the same as likes. There is no difference. Clicking on a heart on Twitter increments the favourite count.

https://twittercommunity.com/t/hearts-and-likes-are-live/55642

like image 63
Terence Eden Avatar answered Oct 19 '22 10:10

Terence Eden