如何从Facebook点赞按钮获取点赞数?

21

如何从Facebook点赞按钮获取点赞数量?是否有可能做到这一点?

1个回答

26

获取Facebook点赞数的方法有两种。

  1. Graph API

http://graph.facebook.com/?ids=http%3a%2f%2ffacebook.com

结果是JSON格式:(由于某种原因,“likes”被称为“shares”)

{
   "http://facebook.com": {
      "id": "http://facebook.com",
      "shares": 35641554,
      "comments": 339
   }
}
  1. FQL

http://api.facebook.com/method/fql.query?query=select+total_count+from+link_stat+where+url="http://facebook.com"'

结果:

<?xml version="1.0" encoding="UTF-8"?>
<fql_query_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" list="true">
  <link_stat>
    <total_count>35641554</total_count>
  </link_stat>
</fql_query_response>

这个被称为“shares”的原因可能是因为在Like Button文档中的陈述,阅读 What makes up the number shown on my Like button? 部分。 - Juicy Scripter
1
你知道在一个请求中可以获取多少链接的统计数据吗?我需要这个信息来设计我的程序,但是在文档中找不到。非常感谢。 - Damien
FQL将从2016年8月起不再提供:https://developers.facebook.com/docs/reference/fql/ - mm24

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接