Created
November 16, 2014 07:06
-
-
Save geekingfrog/cf90cf52d2e645b4a53c to your computer and use it in GitHub Desktop.
Basic recursive call
This file contains hidden or 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
function parsePage(url, depth) { | |
if(!depth) depth = 1; | |
if(depth > 3) return; | |
// here, fetch the page and save it to disk | |
// then process each links | |
extractLinksFromPage(body).forEach(function(link) { | |
parsePage(link, depth++); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment