Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: Getting the favorite_count from a Tweet

$
0
0
I think we are discussing different things. Sorry for the long data dump but I wanted to provide all the information I compiled while researching this:

Let's use Tweet 210462857140252672 as an example. You'll see by this link (https://twitter.com/twitterapi/status/210462857140252672) that the Tweet has been favorited 54 times. But, if you you query above using Tweetinvi.Tweet.GetTweet() and take the the information from ITweet.(IUser)Creator.FavouritesCount, the number is 26:

Image

So the ITweet.(IUser)Creator.FavouritesCount is clearly not correct, as it does not match the favorites count on that tweet. Sure enough, if you look at the Twitter API documentation on the User object (https://dev.twitter.com/docs/platform-objects/users), you get this:

Image

Pretty clear that this does not relate to this Tweet but to other tweets the user has favorited. Since Twitter has changed its clients to put favoriting a tweet more in the forefront, capturing the per-tweet favorite count is essential for us.

This favorite tweet count number should be simple to add into Tweetinvi as Twitter is already returning this number as part of the tweet object (https://dev.twitter.com/docs/platform-objects/tweets):

Image

And if you query the API directly, it does indeed return us that the tweet has been favorited 54 times by looking at the favorite_count property, which is a direct sibling to the retweet_count number:
{"created_at":"Wed Jun 06 20:07:10 +0000 2012","id":210462857140252672,"id_str":"210462857140252672","text":"Along with our new #Twitterbird, we've also updated our Display Guidelines: https:\/\/t.co\/Ed4omjYs  ^JC","source":"web","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":6253282,"id_str":"6253282","name":"Twitter API","screen_name":"twitterapi","location":"San Francisco, CA","description":"The Real Twitter API. I tweet about API changes, service issues and happily answer questions about Twitter and our API. Don't get an answer? It's on my website.","url":"http:\/\/t.co\/78pYTvWfJd","entities":{"url":{"urls":[{"url":"http:\/\/t.co\/78pYTvWfJd","expanded_url":"http:\/\/dev.twitter.com","display_url":"dev.twitter.com","indices":[0,22]}]},"description":{"urls":[]}},"protected":false,"followers_count":2128478,"friends_count":46,"listed_count":12607,"created_at":"Wed May 23 06:01:13 +0000 2007","favourites_count":26,"utc_offset":-25200,"time_zone":"Pacific Time (US & Canada)","geo_enabled":true,"verified":true,"statuses_count":3491,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/656927849\/miyt9dpjz77sc0w3d4vj.png","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/656927849\/miyt9dpjz77sc0w3d4vj.png","profile_background_tile":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/2284174872\/7df3h38zabcvjylnyfe3_normal.png","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/2284174872\/7df3h38zabcvjylnyfe3_normal.png","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/6253282\/1347394302","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":[14927800],"retweet_count":70,"favorite_count":54,"entities":{"hashtags":[{"text":"Twitterbird","indices":[19,31]}],"symbols":[],"urls":[{"url":"https:\/\/t.co\/Ed4omjYs","expanded_url":"https:\/\/dev.twitter.com\/terms\/display-guidelines","display_url":"dev.twitter.com\/terms\/display-\u2026","indices":[76,97]}],"user_mentions":[]},"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"en"}
Would it be possible to integrate this tweet favorite_count number into Tweetinvi?

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>