1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.
  2. Better Analytics for WordPress Get It Free

[help]display fql query

Discussion in 'Facebook API' started by natsu90, Dec 11, 2010.

  1. #1
    sorry i'm kinda noob on this. i have this to count how many likes on a site,
    https://api.facebook.com/method/fql.query?query=SELECT%20like_count%20FROM%20link_stat%20WHERE%20url=%22http://www.ngendl.com%22
    Code (markup):
    it was displayed good using browser but how can i display the result using html on my site?
    any reply will very appreciate. thanks.
     
    natsu90, Dec 11, 2010 IP
  2. natsu90

    natsu90 Greenhorn

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    ok i'm not bumping my own thread. i've go thru on google and tried to use javascript sdk,
    FB.api(
      {
        method: 'fql.query',
        query: 'SELECT like_count FROM link_stat WHERE url="http://www.ngendl.com"'
      },
      function(response) {
        document.write(response.like_count);
      }
    );
    Code (markup):
    but still doesnt work.
     
    natsu90, Dec 12, 2010 IP
  3. ankit_frenz

    ankit_frenz Active Member

    Messages:
    1,114
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    63
    #3
    use php sdk that will be more appropriate if you want to display in your browser...btw for that there were some direct codes from fb i guess
     
    ankit_frenz, Dec 14, 2010 IP
  4. Ninestein

    Ninestein Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yeah, the PHP SDK is good.

    Also, you might need to set the method to "facebook.fql_query". I spent weeks pulling my hair out trying to get it working. Only think I'm not happy with is the speed of the response. If you find a faster way to do it, would love to know.

    $facebook->api(array(
    'method' => 'facebook.fql_query',
    'query' => 'SELECT like_count FROM link_stat WHERE url IN ('.$URL.')'
    ));
     
    Ninestein, Dec 21, 2010 IP