Created
May 25, 2013 12:19
-
-
Save mlaug/5648897 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Crawler = require("crawler").Crawler; | |
var c = new Crawler({ | |
// here you can define, how many pages you want to do in parallel | |
"maxConnections":10, | |
// This will be called for each crawled page | |
"callback":function(error,result,$) { | |
// mark this page as available or not based on the reponse | |
console.log(result.statusCode); | |
} | |
}); | |
// Queue all your urls in a loop, they all will be push asynchronously to the crawler job | |
c.queue("http://www.google.de"); | |
c.queue("http://www.amazon.de"); | |
c.queue("http://www.facebook.de"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment