Get Facebook “Like” count for every page on my domain

前端 未结 8 920
孤独总比滥情好
孤独总比滥情好 2020-12-07 13:35

I have integrated the Facebook \"Like\" button into a lot of pages in my site. I want to display the most \"Liked\" pages on my site in a list, but I can\'t figure out how

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 14:29

    In continuation to Salil's answer, here are the some of the major APIs sharedcount.com are using (full list here: http://sharedcount.com/documentation.php)

    You can use sharedcount's API to get a general summary, or write something yourself using the APIs:

    • Facebook: http://api.ak.facebook.com/restserver.php?v=1.0&method=links.getStats&urls=%%URL%%&format=json
    • Twitter: http://urls.api.twitter.com/1/urls/count.json?url=%%URL%%&callback=twttr.receiveCount
    • Google +1 +1 counts are retrieved via a JSON-RPC POST call that requires an API key (To get a google API key - https://developers.google.com/+/api/oauth#apikey):

      POST URL: https://clients6.google.com/rpc?key=%%API-KEY%%

      POST Body: [{"method":"pos.plusones.get","id":"p","params":{"nolog":true,"id":"%%URL%%","source":"widget","userId":"@viewer","groupId":"@self"},"jsonrpc":"2.0","key":"p","apiVersion":"v1"}]

提交回复
热议问题