0

i am trying to figure the best way to go about getting the number of retweets for a given tweet and likewise the number of comments for a specific facebook post.

I know there are api calls to retrieve these things individually using their respective apis however my question is how to achieve this on different platforms.

For example lets say i have both a web app and iOS app that i would like my users to be able to share images from to either facebook or twitter. I have used something like ShareKit on iOS to share the images and i could probably tweak it to capture the id for the tweet/post which i could then send back to the web app to store in a db.

Question is then how do i go about getting the number of retweets/likes for these tweets and posts? Issue being that is that as far as i understand these are authenticated calls and i wouldnt have the proper authentication to get that info from facebook/twitter as the user would only have authorized my iOS app and not the web app? Is there a way for me to pass on the user authentication to my server from the iOS and then use that when making the calls to get the number of retweets/likes?

Any ideas?

Thx

4

1 回答 1

2

无需进行身份验证即可查看推文有多少转推。

显示推文的文档非常清楚地说明了这一点。

假设推文 ID 是 211912719195058176

你可以调用 Twitter 的 API

https://api.twitter.com/1/statuses/show.json?id=211912719195058176&include_entities=true

在响应中,您将看到

"retweet_count":26

就是这么简单。

于 2012-06-18T07:00:18.653 回答