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

与世无争的帅哥 提交于 2019-12-02 16:19:36

问题


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 'likes', then it starts updating every 1000 'likes'.

So you could se:

0 likes

1 like

2 likes

..

..

100 likes

..

..

999 likes

1000 likes (then it's not updated onclick until)

2000 likes (then it's not updated onclick until)

3000 likes (then it's not updated onclick until)

...

Is there a way to update the value on every click?


回答1:


You could set layout style to standard instead of the box count. But the way box count works is that it displays a rounded number and that isn't currently configurable. You could log a feature request on their bug tracker tool.




回答2:


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



来源:https://stackoverflow.com/questions/7820061/facebook-like-button-updates-the-value-for-every-1-000-likes-can-it-update-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!