Skip to content

Instantly share code, notes, and snippets.

@ptasker
Created November 8, 2012 17:45
Show Gist options
  • Select an option

  • Save ptasker/4040329 to your computer and use it in GitHub Desktop.

Select an option

Save ptasker/4040329 to your computer and use it in GitHub Desktop.
Facebook JS SDK API - FQL Query
//The following FQL get's events attached to a page. But it could be any FQL query.
var Q = "SELECT eid, name, description, pic_big, start_time, end_time, location FROM event WHERE creator = PAGE_ID AND eid IN (SELECT eid FROM event_member WHERE uid = PAGE_ID)";
FB.api("/fql?q=" + encodeURIComponent(Q), function(response) {
console.log(response);
}, 'get', {
access_token: 'GENERATED_APP_ACCESS_TOKEN'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment