How can I get the list of top 10 artciles shared on Facebook using Graph API or FQL?

天涯浪子 提交于 2020-01-11 03:28:04

问题


On my site, I have Facebook share plugin so that users can share articles on Facebook. Now I want a report of top 10 articles shared on Facebook from my site in last one week or month.

I tried using FQL,

https://graph.facebook.com/fql?q=SELECT url, normalized_url, share_count, like_count, comment_count, total_count FROM link_stat WHERE url like '%www.indiatimes.com%' order by total_count desc limit 10

But 'like' keyword doesn't work in fql. Please advice.


回答1:


I suggest you to do this way:

For example: Articles from http://googledevelopers.blogspot.com (It may not work on all website, so you may try your luck.)

https://graph.facebook.com/search?q=googledevelopers.blogspot.com&type=post&limit=25

The you can collect all link/message/...etc which was exist/valid article on the domain(For example, http://googledevelopers.blogspot.com/2013/05/an-easier-way-to-save-files-to-google.html is exist and consider increment one count, however http://googledevelopers.blogspot.com is not consider one count.)

You collect ALL via pagination "until=", until one week or month and you stop pagination.

Of course, each count should be tied to one post id. Remove these count which was duplicated post_id.(May happen when both message and link contains 'http://googledevelopers.blogspot.com/2013/05/an-easier-way-to-save-files-to-google.html', so it should consider as only one count)

Sum all counts for each unique articles.(For example, http://googledevelopers.blogspot.com/2013/05/an-easier-way-to-save-files-to-google.html have 3 counts), then sort all those articles by counts. Again, make sure no duplicated post_id for all count.

Cheers



来源:https://stackoverflow.com/questions/14316467/how-can-i-get-the-list-of-top-10-artciles-shared-on-facebook-using-graph-api-or

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