Tuesday, April 9, 2013

facebook fql format

pay attention to the "+" in the fql


 // 1.
 $access_token="XXX";
 $url0 = "https://graph.facebook.com/"
    . "fql?q=SELECT+message,time,status_id+FROM+status+WHERE+uid=10000+"
    . "AND+time>=1365481000+AND+time<=1365483292+LIMIT+0,1"
    . "&access_token=" . $access_token;

 $res0 = json_decode(file_get_contents($url0));


//2.

$url1 = "https://graph.facebook.com/"
                   . "fql?q=SELECT+fromid,time,text,object_id+FROM+comment+WHERE+object_id+"
                   ."IN+(SELECT+status_id+FROM+status+WHERE+uid=$uid)+"
                   ."AND+time>=$tm1+AND+time<=$tm2"
                   . "&access_token=" . $access_token;
$res1 = json_decode(file_get_contents($url1));

No comments:

Post a Comment