1

I want to create a simple "about us" page in my android app from where user can go to the facebook page to have more information about application. I have done this through hyperlink but I am unable to fetch the number of likes for that facebook page using hyperlink. I have searched the solution for it but everywhere I got suggestion to install "Facebook SDK" which is very tedious & lengthy procedure when I just want to have number of likes on the page. I don't want to integrate facebook in my app to provide user facilities like FB login or status update through app etc. My only & simple requirement is to fetch number of likes on the page so is there any simple way to do this or I will have to go with installing Facebook SDK. Please help...

4

1 回答 1

3

Just do a simple HTTP GET request to the following URL:

https://graph.facebook.com/fql?q=SELECT%20url,%20normalized_url,%20share_count,%20like_count,%20comment_count,%20total_count,%20commentsbox_count,%20comments_fbid,%20click_count%20FROM%20link_stat%20WHERE%20url=%27http://www.stackoverflow.com%27

Change http://www.stackoverflow.com to whatever page you want to check.

The above URL will return something like this:

{
   "data": [
      {
         "url": "http://www.stackoverflow.com",
         "normalized_url": "http://www.stackoverflow.com/",
         "share_count": 5206,
         "like_count": 1745,
         "comment_count": 1938,
         "total_count": 8889,
         "commentsbox_count": 3,
         "comments_fbid": 450042939888,
         "click_count": 91
      }
   ]
}
于 2013-03-04T09:59:47.610 回答