Advertisement
Guest User

Stack Overflow Question 12786738

a guest
Oct 9th, 2012
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. <?
  2. $access_token = 'INSERT YOUR ACCESS TOKEN HERE';
  3. $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)';
  4. $fql['query1'] = sprintf($query_format, 'ASC');
  5. $fql['query2'] = sprintf($query_format, 'DESC');
  6. $fql_out = urlencode(json_encode(preg_replace('/\s+/', ' ', $fql)));
  7. $url_format = 'https://graph.facebook.com/fql?q=%s&access_token=%s';
  8. $fb_url = sprintf($url_format, $fql_out, $access_token);
  9. $res = json_decode(file_get_contents($fb_url), TRUE);
  10. printf('<pre>%s</pre>', print_r($res, TRUE));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement