VOOZH about

URL: https://www.geeksforgeeks.org/python/python-tweepy-getting-the-number-of-times-a-tweet-has-been-favourited/

⇱ Python Tweepy – Getting the number of times a tweet has been favourited - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Python Tweepy – Getting the number of times a tweet has been favourited

Last Updated : 18 Jun, 2020
In this article we will see how we can get the number of times a tweet/status has been favourited. The favorite_count attribute of the Status object provides us with the number of times a tweet has been favourited. Identifying the number of times a tweet has been favourited in the GUI : 👁 Image
The above mentioned status has been favourited 16 times.
In order to get the number of times a status has been favourited, we have to do the following :
  1. Identify the status ID of the status from the GUI.
  2. Get the Status object of the status using the get_status() method with the status ID.
  3. From this object, fetch the favorite_count attribute present in it.
Example 1 : Consider the following status : 👁 Image
We will use the status ID to fetch the status. The status ID of the above mentioned status is 1272771459249844224. Output :
The number of time the status has been favourited is : 17
Example 2 : Consider the following status : 👁 Image
We will use the status ID to fetch the status. The status ID of the above mentioned status is 1272479136133627905.
Output :
The number of time the status has been favorited is : 19
Comment
Article Tags:
Article Tags: