How do I get the likes number from facebook for a given url?

喜你入骨 提交于 2019-12-24 14:15:15

问题


A url http://www.cnn.com/2014/03/15/world/asia/malaysia-airlines-passenger-vignettes/index.html?hpt=hp_t1

How can I get the facebook like number or twitter posts number or google+ number from this url?


回答1:


You can use the following FQL via the Graph API:

select url, like_count from link_stat where url='http://edition.cnn.com/2014/03/15/world/asia/malaysia-airlines-passenger-vignettes/index.html'

like this:

https://graph.facebook.com/fql?q=select%20url%2C%20like_count%20from%20link_stat%20where%20url%3D%27http%3A%2F%2Fedition.cnn.com%2F2014%2F03%2F15%2Fworld%2Fasia%2Fmalaysia-airlines-passenger-vignettes%2Findex.html%27

which gives the result

{
  "data": [
    {
      "url": "http://edition.cnn.com/2014/03/15/world/asia/malaysia-airlines-passenger-vignettes/index.html", 
      "like_count": 28529
    }
  ]
}


来源:https://stackoverflow.com/questions/22677398/how-do-i-get-the-likes-number-from-facebook-for-a-given-url

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