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.

[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,
    Code (Text):
    1. https://api.facebook.com/method/fql.query?query=SELECT%20like_count%20FROM%20link_stat%20WHERE%20url=%22http://www.ngendl.com%22
    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

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

    ankit_frenz Active Member

    Likes Received:
    Best Answers:
    Trophy Points:
    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

    Likes Received:
    Best Answers:
    Trophy Points:
    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.

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