views:

92

answers:

1

Hey guys,

So I'm trying to learn how to get link stats for a URL using Facebook's API.

This is what I have here:

    require "application/libraries/facebook.php";

    // Create our Application instance (replace this with your appId and secret).
    $facebook = new Facebook(array(
      'appId'  => 'APP ID WAS HERE',
      'secret' => 'SECRET IS A SECRET',
      'cookie' => true,
    ));

    $fql    =   'SELECT total_count FROM link_stat WHERE url=\"http://google.com\"';
    $param  =   array(
        'method'    => 'fql.query',
        'query'     => $fql,
        'callback'  => ''
    );  
    $fqlResult   =   $facebook->api($param);

That's giving me a blank page. Could it be that I'm not testing this on the website registered with the FB Application?

I'm lost.

Thanks, Dan

A: 

use facebook fql console to verify that your fql statement actually works, (say here: http://developers.facebook.com/docs/reference/rest/links.getstats )