Created
September 8, 2017 14:07
-
-
Save wellavelino/2665872b70a01f1c2761b6841adac79c to your computer and use it in GitHub Desktop.
crawler_algorithm.rb
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
while(list of unvisited URLs is not empty) { | |
take URL from list | |
fetch content | |
record whatever it is you want to about the content | |
if content is HTML { | |
parse out URLs from links | |
foreach URL { | |
if it matches your rules | |
and it's not already in either the visited or unvisited list | |
add it to the unvisited list | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment