Facebook like button updates the value for every 1,000 'likes'. Can it update on every 'like'?

后端 未结 2 460
忘了有多久
忘了有多久 2021-01-28 19:55

I guess you realised that, when on a website, you click on the \'like\' button -with counter- it normally updates one like by one like in the first ones. Until it reaches 1000 \

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-28 20:29

    You can query the exact 'like' count yourself and create a custom counter.

    example in PHP

    $url = 'http://example.com';
    $facebook_data = json_decode(file_get_contents("http://api.facebook.com/method/fql.query?query=select%20total_count,commentsbox_count%20from%20link_stat%20where%20url='{$url}'&format=json"));
    echo $facebook_data[0]->total_count;
    

    You can see a working example of this on http://askdavid.com

提交回复
热议问题