Question

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?

Was it helpful?

Solution

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
    }
  ]
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top