How to get number of likes from facebook like button?

How to get number of likes from facebook like button? Is there any possible way to do this?

Answers


There are two ways to get the number of facebook likes.

  1. Graph API

http://graph.facebook.com/?ids=http%3a%2f%2ffacebook.com

Result is JSON: (For some reason 'likes' are called 'shares')

{
   "http://facebook.com": {
      "id": "http://facebook.com",
      "shares": 35641554,
      "comments": 339
   }
}
  1. FQL

http://api.facebook.com/method/fql.query?query=select+total_count+from+link_stat+where+url="http://facebook.com"'

Result:

<?xml version="1.0" encoding="UTF-8"?>
<fql_query_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" list="true">
  <link_stat>
    <total_count>35641554</total_count>
  </link_stat>
</fql_query_response>

Need Your Help

How to export & import functions and execute them with MEF?

c# function import export mef

I am creating an application that imports several plugins. I need the ability to execute functions that are implemented in each of the plugins. For example, I need to do something like this.

Extract C++ template parameters

c++ templates rtti

Although I'm doubtful, I'm curious as to whether it's possible to extract primitive-type template parameters from an existing type, perhaps using RTTI.