Skip to content

Instantly share code, notes, and snippets.

@gildean
Created January 19, 2013 21:54
Show Gist options
  • Save gildean/4575431 to your computer and use it in GitHub Desktop.
Save gildean/4575431 to your computer and use it in GitHub Desktop.
recursion
var httprequest = require('request');
var page = 1;
(function repeat() {
var req = httprequest("http://www.google.com", function (error, response, body) {
console.log(response.statusCode);
if (page < 2) {
page += 1;
repeat();
} else {
console.log('done');
}
});
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment