2

次のように作成された、私のウェブサイトに 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
    }
  ]
}

正確なカウント数を取得するにはどうすればよいですか?

4

1 に答える 1

1

正確な類似数は、そこに表示される total_count です。何らかの理由で、Facebook はコメントやシェアをいいねボタンでいいねとしてカウントします。

http://example.comはhttps://example.comhttp://www.example.com/とは異なることを忘れないでください 。これらのエイリアスをすべて追加してください。

于 2012-10-30T14:14:11.187 に答える