How do you get the total likes for a URL (Likes and Shares)?

前端 未结 2 716
孤城傲影
孤城傲影 2021-01-03 10:20

The \"Likes\" plugin that I\'ve dropped on my page displays both the number of times the button has been directly clicked, as well as the number of times the page URL has be

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-03 10:33

    I found two ways of doing this. The new way utilizing the graph api appears to be to be to use fql, as the following request shows:

    https://graph.facebook.com/fql?q=SELECT url, normalized_url, share_count, like_count, comment_count, total_count, commentsbox_count, comments_fbid, click_count FROM link_stat WHERE url='http://mysite.com/8/the-dali-lama-returns'
    

    The old way, with the Rest API which is in the process of being deprecated:

    link.getStats()
    

    https://developers.facebook.com/docs/reference/rest/links.getStats/

提交回复
热议问题