Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
Created October 28, 2013 13:16
Show Gist options
  • Save sindresorhus/7196607 to your computer and use it in GitHub Desktop.
Save sindresorhus/7196607 to your computer and use it in GitHub Desktop.
Get latest picture from Facebook user using FQL
var endpoint = 'https://graph.facebook.com/fql';
var accessToken = '';
var userId = '';
var q = 'SELECT caption, src_big FROM photo WHERE aid IN(SELECT aid FROM album WHERE owner = ' + userId + ' ORDER BY modified DESC LIMIT 1) ORDER BY modified DESC LIMIT 1';
var url = endpoint + '?access_token=' + accessToken + '&q=' + q;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment