使用图形API
回答
我不认为这是有可能得到像从图形API的数量,你应该使用FQL link_stat table。 FQL不被弃用。
向下投票,因为这是不正确的,根据@chandrajeet回答 – Luke 2014-03-18 08:57:10
更新 - 四月'15:
如果你想获得那就是在Like按钮可用计数,你应该使用engagement
字段中og_object
对象,像这样:
https://graph.facebook.com/v2.2/?id=http://www.MY-LINK.com&fields=og_object{engagement}&access_token=<access_token>
结果:
{
"og_object": {
"engagement": {
"count": 93,
"social_sentence": "93 people like this."
},
"id": "801998203216179"
},
"id": "http://techcrunch.com/2015/04/06/they-should-have-announced-at-420/"
}
这是可能的图形API,只需使用:
http://graph.facebook.com/?id=YOUR_URL
类似:
http://graph.facebook.com/?id=http://www.google.com
将返回:
{
"id": "http://www.google.com",
"shares": 1163912
}
UPDATE:而上面会回答如何获得分享伯爵。这个数字是不等于你在Like Button看到一个,因为这个数字的总和:
- 这个URL
- ,此网址的股份数量的喜欢的(这包括数将链接复制/粘贴回Facebook)
- Facebook上关于此URL的点赞和评论数
- 包含此URL作为附件的收件箱邮件的数量。
因此获得Like按钮数量是可能通过fql
终点的图形API(在link_stat
表):
https://graph.facebook.com/fql?q=SELECT url, normalized_url, share_count, like_count, comment_count, total_count,commentsbox_count, comments_fbid, click_count FROM link_stat WHERE url='http://www.google.com'
total_count
是显示了Like按钮的数量。
你不应该使用图形api。如果您透过电话:
或
都将返回:
{
"id": "http://www.apple.com",
"shares": 1146997
}
但显示的数字是的总和:
- 数目这个URL
- 数的这个URL的股的喜欢的(这包括复制/粘贴链接回到Facebook)的
- 数Facebook上有关此URL的故事的评论和评论
- 包含此URL作为附件的收件箱邮件的数量。
所以你必须使用FQL。
看看这个答案:How to fetch facebook likes, share, comments count from an article
你是绝对正确的,通过total_shares是的评论+喜欢+股 但我请求的页面总和,显示shares_i_have = total_shares +喜欢 – Aziz 2012-02-22 05:58:29
当我用FQL我发现这个问题(但它仍然是问题) 的文件说,显示的数字是的总和:
- 数量的这种喜欢的URL
- 号,此网址的股份(此 包括复制/粘贴链接回到Facebook的)这个网址在Facebook上
- 号喜欢和 意见对故事
- 收件箱号码 包含此URL作为附件的邮件。
,但在我的网站所示数量为这4个计数总和+股数(再次)
像按钮Facebook的做了两两件事,该API不会做。当你比较两者时,这可能会造成混乱。
如果你在像按钮使用URL有重定向的按钮将实际显示重定向URL与您所使用的URL的数量的计数。
如果页面有一个og:url属性,like按钮将显示喜欢的URL,而不是浏览器中的URL。
希望这可以帮助别人
这里的API链接的列表,让您的数据:
Facebook的: https://api.facebook.com/method/links.getStats?urls=%%URL%%&format=json
reddit的:http://buttons.reddit.com/button_info.json?url=%%URL%%
LinkedIn:http://www.linkedin.com/countserv/count/share?url=%%URL%%&format=json
Digg: 种http://widgets.digg.com/buttons/count?url=%%URL%%
美味:
的StumbleUpon: http://www.stumbleupon.com/services/1.01/badge.getinfo?url=%%URL%%
Pinterest的: http://widgets.pinterest.com/v1/urls/count.json?source=6&url=%%URL%%
编辑: 删除Twitter的终点,因为这一个已被弃用。
编辑: Facebook的REST API已被弃用
使用FQL,你可以这样做:
http://graph.facebook.com/fql?q=SELECT url, total_count FROM link_stat WHERE url='PASTE_YOUR_URL_HERE'
有它红宝石宝石 - SocialShares
目前,它支持以下社交网络:
- 叽叽喳喳
- 谷歌加
- 书签交易
- Pinterest的
- 的StumbleUpon
- VKontakte等
- mail.ru
- odnoklassniki
ù鼠尾草:
:000 > url = 'http://www.apple.com/'
=> "http://www.apple.com/"
:000 > SocialShares.facebook url
=> 394927
:000 > SocialShares.google url
=> 28289
:000 > SocialShares.twitter url
=> 1164675
:000 > SocialShares.all url
=> {:vkontakte=>44, :facebook=>399027, :google=>28346, :twitter=>1836, :mail_ru=>37, :odnoklassniki=>1, :reddit=>2361, :linkedin=>nil, :pinterest=>21011, :stumbleupon=>43035}
:000 > SocialShares.selected url, %w(facebook google linkedin)
=> {:facebook=>394927, :google=>28289, :linkedin=>nil}
:000 > SocialShares.total url, %w(facebook google)
=> 423216
:000 > SocialShares.has_any? url, %w(twitter linkedin)
=> true
结帐this gist。它有如何获得以下服务共享计数片段:
- Facebook的
- Twitter的
- 谷歌,加上
- Pinterest的
- StumbledUpon
这是几年的历史。每个服务更新其API的频率,我怀疑它是非常准确的。 – subvertallchris 2015-04-14 18:36:03
什么我发现有用的,我发现上面的一个链接是这个FQL查询,你问对于喜欢,总,共享和点击一个链接数通过查看link_stat表
https://graph.facebook.com/fql?q=SELECT%20like_count,%20total_count,%20share_count,%20click_count,%20comment_count%20FROM%20link_stat%20WHERE%20url%20=%20%22http://google.com%22
这将输出这样的事情:
{
data: [
{
like_count: 3440162,
total_count: 13226503,
share_count: 7732740,
click_count: 265614,
comment_count: 2053601
}
]
}
截至2016年8月8日,FQL将不再可用且无法查询。要迁移您的应用,请使用API升级工具查看您可以改为创建的图表API调用。 – 2016-08-04 12:52:47
8月7日以后年,2016年仍然可以使您的通话像这样:
http://graph.facebook.com/?id=https://www.apple.com/
但响应格式将是不同的:它不会是
{
"id": "http://www.apple.com",
"shares": 1146997
}
,而是它会
{
"og_object": {
"id": "388265801869",
"description": "Get a first look at iPhone 7, Apple Watch Series 2, and the new AirPods \u2014 the future of wireless headphones. Visit the site to learn more.",
"title": "Apple",
"type": "website",
"updated_time": "2016-09-20T08:21:03+0000"
},
"share": {
"comment_count": 1,
"share_count": 1094227
},
"id": "https://www.apple.com"
}
所以,你将不得不处理这样的回应:
reponse_variable.share.share_count
但SHARE_COUNT值是一种误导,因为它是指喜欢+股 – 2017-03-05 10:21:29
我想你是对的总和,我的回答只是如何调用API的更新。我认为@freedev关于股票数量的评论可能仍然是正确的。 – 2017-03-08 09:14:40
太棒了!多数民众赞成唯一一个真正有效的,你不需要一个应用程序ID! – neoswf 2018-02-21 11:30:27
只需输入https://graph.facebook.com/?fields=share&id=https://www.example.com
,并与您的网址或网页您正在寻找替代例如。谷歌的
例子: https://graph.facebook.com/?fields=share&id=https://www.google.com
- 1. 使用图形API
- 2. 使用图形API
- 3. 使用图形API
- 4. 如何使用图形API
- 5. 喜欢使用图形API
- 6. 如何使用图形API
- 7. 如何使用图形API
- 8. 如何使用图形API
- 9. 使用图形API 2.7
- 10. 使用Facebook的图形API
- 11. 签使用图形API
- 12. 评论使用Facebook图形API api
- 13. 使用图形API发布图像
- 14. 使用java图形API绘制图层
- 15. 使用图形api构建图片
- 16. Facebook图形API,没有使用图片
- 17. 使用图形API更新用户“relationship_status”
- 18. Google图形API /某种图形API
- 19. 使用图形API获取图像的缩略图Api
- 20. 如何通过形式上传图片使用图形API
- 21. 使用java图形API(2D/3D/OpenGL /等)的交互式图形?
- 22. 如何使用Microsoft图形API
- 23. 检索使用FB图形API
- 24. 使用Google Chart API注释条形图
- 25. 号线使用Java图形API
- 26. 使用图形API获取Facebook反应
- 27. 接受或使用FB图形API
- 28. “喜欢”使用Facebook的图形API
- 29. 如何使用图形API在Facebook的
- 30. 使用Facebook的图形API和HybridAuth
获取您的解决方案在这里http://stackoverflow.com/questions/6137414/how-to-fetch-facebook-likes-share-comments-count-from-一篇文章 – 2013-06-14 14:28:10
请检查答案在这里:http://stackoverflow.com/questions/9728279/getting-the-facebook-like-share-count-for-a-given-url/35062056#35062056 – 2016-01-28 12:54:07
Post 8月8日, 2016(非弃用)回答:http://stackoverflow.com/a/39379251/4607317 – 2016-10-17 19:45:06