获取特定 URL 的 facebook *shares* 数量 [英] Get the number of facebook *shares* of a specific URL
问题描述
我在图形 API 中发现了一些差异,想知道是否有人能够解决这些问题.
I've found some discrepancies in the graph api and was wondering if anybody has been able to work around them.
https://graph.facebook.com/?id=http://www.imdb.com/title/tt0117500/ 输出一个喜欢"数字以及 imdb 提供的所有开放图信息,与其 fb:app_id 相关联.https://graph.facebook.com/?id=http:///www.google.com 但是会输出shares"数,因为 google 不提供 fb:app_id 或 fb:admins.
https://graph.facebook.com/?id=http://www.imdb.com/title/tt0117500/ outputs a "likes" number together with all of the open graph info provided by imdb, associated to its fb:app_id. https://graph.facebook.com/?id=http://www.google.com however, outputs the "shares" number, as google doesn't provide an fb:app_id or fb:admins.
我的问题是我需要第一个 URL 的共享"编号,因为它对应于其 赞按钮(赞+评论等)
My problem is that I need the "shares" number for the first URL, as it corresponds with the number exposed in its like button (likes + comments, etc.)
有没有办法可靠地获取任何 URL 的共享"数?
Is there any way to reliably get this "shares" number for any URL?
推荐答案
此 API 不再可用.以下答案不再有效.
This API is no longer available. The answer below is no longer valid.
我可以通过 GET 请求获取页面的统计信息(比如 http://techcrunch.com)应用程序接口.只需放置此 GET 请求 http://api.facebook.com/restserver.php?method=links.getStats&urls=[YOUR_URL]
并获取统计信息.
I could get stats of a page (say http://techcrunch.com) with just a GET request to API. Just place this GET request http://api.facebook.com/restserver.php?method=links.getStats&urls=[YOUR_URL]
and get the stats.
喜欢 http:///api.facebook.com/restserver.php?method=links.getStats&urls=http://techcrunch.com/返回
<links_getStats_response xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">
<link_stat>
<url>http://techcrunch.com/</url>
<normalized_url>http://www.techcrunch.com/</normalized_url>
<share_count>6244</share_count>
<like_count>1513</like_count>
<comment_count>1391</comment_count>
<total_count>9148</total_count>
<click_count>4007</click_count>
<comments_fbid>433841427570</comments_fbid>
<commentsbox_count>4</commentsbox_count>
</link_stat>
</links_getStats_response>
希望这会有所帮助.
另外,
如果您希望该响应为 JSON,只需将 &format=json
附加到请求 URL – Dexter
(来自评论.谢谢德克斯特!)
If you want that response as a JSON, just append &format=json
to request URL – Dexter
(from the comment. Thanks Dexter!)
这篇关于获取特定 URL 的 facebook *shares* 数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!