如何从Facebook点赞按钮获取点赞数量?是否有可能做到这一点?
获取Facebook点赞数的方法有两种。
http://graph.facebook.com/?ids=http%3a%2f%2ffacebook.com
结果是JSON格式:(由于某种原因,“likes”被称为“shares”)
{
"http://facebook.com": {
"id": "http://facebook.com",
"shares": 35641554,
"comments": 339
}
}
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>