Skip to content

Instantly share code, notes, and snippets.

@gabrielhpugliese
Created February 27, 2013 22:30
Show Gist options
  • Save gabrielhpugliese/5052452 to your computer and use it in GitHub Desktop.
Save gabrielhpugliese/5052452 to your computer and use it in GitHub Desktop.
get_data = function(user_id, path, fql) {
var token = Meteor.users.findOne(user_id).services.facebook.accessToken,
fb_url = 'https://graph.facebook.com',
response;
if (path) {
response = Meteor.http.get(fb_url + path + '?access_token=' + encodeURIComponent(token));
} else {
response = Meteor.http.get(fb_url + '/fql?q=' + fql + '&access_token=' + encodeURIComponent(token));
}
return response;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment