Skip to content

Instantly share code, notes, and snippets.

@abi
Created September 25, 2010 19:57
Show Gist options
  • Save abi/597220 to your computer and use it in GitHub Desktop.
Save abi/597220 to your computer and use it in GitHub Desktop.
//Get access token from clicking one of the urls on
//http://developers.facebook.com/docs/api
//and copying the access_token GET param
var http = require('http');
var fb = http.createClient(443, 'graph.facebook.com');
try{
fb.setSecure(); //SSL
var request = fb.request('GET',
'/btaylor?access_token=[INSERT ACCESS TOKEN HERE]',
{'host': 'graph.facebook.com'});
request.end();
request.on('response', function (response) {
console.log(response.statusCode);
var body = "";
response.addListener('data', function(chunk) {
body += chunk;
});
response.addListener('end', function() {
console.log(body);
});
});
}catch(e){
console.log(e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment