Facebook – Using Facebook graph to see what is trending/most “liked”

facebook

This may sound weird but it seems like everyone and their mom has a "like this" article on Facebook. But Facebook really hasn't done a thing with all this data that they have been mining! Is there a way to call some of this data through the Facebook graph?

All I can find is something like this:

https://graph.facebook.com/?ids=http://www.imdb.com/title/tt1375666/

It would be great if I could call based on the number of likes a site or article has.

Best Answer

You cannot get articles or websites based on the number of likes just like that. However, you can "simulate" this by taking one of the two paths: (1) using Facebook social plugins, or (2) checking specific URLs using Facebook API.

The first path allows you to track particular domains (Recommendations plugin, http://developers.facebook.com/docs/reference/plugins/recommendations/) with respect to their most popular articles. An example of how to implement the idea can be found here: likebutton.com. There is no API call for that kind of information, so if you do not want to use the default widget, you have to still employ it in order to get the relevant data.

The second path is using Facebook API in order to track popularity of particular articles. For that, you should make API calls with a number of URLs to be checked, and the API returns a likes count (including comments, shares, etc.). Example here: http://api.facebook.com/restserver.php?method=links.getStats&urls=seime.lt. While it might seem like a tedious job, it works like magic if you use it together with RSS. That is, you follow a number of blogs/news portals using their RSS, from that you get URLs of their new articles, and then make calls to Facebook API using those URLs. If you take a quick look at poko.lt (nope, it's not in English), the website uses that same idea for tracking the most popular blog posts in the entire Lithuanian blogosphere.