Skip to content

Instantly share code, notes, and snippets.

@enieber
Last active September 5, 2015 01:08
Show Gist options
  • Save enieber/d5bb4054c43a1fb17406 to your computer and use it in GitHub Desktop.
Save enieber/d5bb4054c43a1fb17406 to your computer and use it in GitHub Desktop.
var http = require('http');
var url = 'http://api.redtube.com/?data=redtube.Videos.searchVideos&search=Sasha%20Gray';
function callback(data){
var chunk = '';
chunk += data;
console.log('chunk: ', chunk)
}
http.get(url, function(res) {
console.log("Got response: " + res.statusCode);
res.on('data', callback)
})
.on('error', function(e) {
console.log("Got error: " + e.message);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment