Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $access_token = 'INSERT YOUR ACCESS TOKEN HERE';
- $query_format = 'SELECT pid, src, link, caption, like_info, created FROM photo WHERE aid in ( SELECT aid FROM album WHERE owner = me() AND type = "profile" AND name = "Profile Pictures" ORDER BY created %s LIMIT 1)';
- $fql['query1'] = sprintf($query_format, 'ASC');
- $fql['query2'] = sprintf($query_format, 'DESC');
- $fql_out = urlencode(json_encode(preg_replace('/\s+/', ' ', $fql)));
- $url_format = 'https://graph.facebook.com/fql?q=%s&access_token=%s';
- $fb_url = sprintf($url_format, $fql_out, $access_token);
- $res = json_decode(file_get_contents($fb_url), TRUE);
- printf('<pre>%s</pre>', print_r($res, TRUE));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement