Advertisement
rogerin

Untitled

Sep 24th, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var url = 'http://graph.facebook.com/517267866/?fields=picture';
  2.  
  3. http.get(url, function(res){
  4.     var body = '';
  5.  
  6.     res.on('data', function(chunk){
  7.         body += chunk;
  8.     });
  9.  
  10.     res.on('end', function(){
  11.         var fbResponse = JSON.parse(body);
  12.         console.log("Got a response: ", fbResponse.picture);
  13.     });
  14. }).on('error', function(e){
  15.       console.log("Got an error: ", e);
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement