我怎样才能得到精确的Facebook?

时间:2012-10-30 13:32:11

标签: facebook facebook-graph-api facebook-like facebook-fql

我的网站上有像Facebook一样的按钮,创建如下:

<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2fexample.com&layout=button_count&show_faces=false&width=110&action=like&colorscheme=light&height=35"
  scrolling="no" frameborder="0"
  allowTransparency="true">
</iframe>

目前的计数显示为1,5 k。我想获得确切数量的喜欢。

我试图查询http://graph.facebook.com/?id=http%3A%2F%2Fexample.com,但我得到的回应是:

{
   "id": "http://example.com",
   "shares": 349
}

我也试过使用FQL:

http://graph.facebook.com/fql?q=SELECT 
                                  like_count,total_count,click_count,commentsbox_count
                                FROM link_stat
                                WHERE url='http%3A%2F%2Fexample.com'

响应是:

{
   "data": [
     {
       "like_count": 251,
       "total_count": 349,
       "click_count": 0,
       "commentsbox_count": 0
    }
  ]
}

如何获得确切的计数?

1 个答案:

答案 0 :(得分:1)

完全相同的数量是你在那里看到的total_count。 出于某种原因,Facebook将评论和分享计算为类似按钮。

不要忘记http://example.comhttps://example.comhttp://www.example.com/不同 确保将所有这些别名加起来。

相关问题