【问题标题】:How to get number of likes from facebook like button?如何从facebook喜欢按钮获得喜欢的数量?
【发布时间】:2011-02-08 08:50:19
【问题描述】:

如何从 facebook like 按钮获得点赞数? 有没有办法做到这一点?

【问题讨论】:

    标签: facebook facebook-like


    【解决方案1】:

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

    1. 图形 API

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

    结果是 JSON:(出于某种原因,“喜欢”被称为“分享”)

    {
       "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>
    

    【讨论】:

    • 这个被称为共享的原因可能是Like Button documentation 上的声明的原因,请阅读我的“赞”按钮上显示的数字是什么?部分
    • 您知道仅在一个请求中可以获得的链接的限制/数量吗?我在设计中需要这些信息,但在文档中找不到。非常感谢。
    • FQL 从 2016 年 8 月起将不再可用:developers.facebook.com/docs/reference/fql
    猜你喜欢
    • 2012-02-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-18
    相关资源
    最近更新 更多