Skip to content

Instantly share code, notes, and snippets.

@wellavelino
Created September 8, 2017 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wellavelino/2665872b70a01f1c2761b6841adac79c to your computer and use it in GitHub Desktop.
Save wellavelino/2665872b70a01f1c2761b6841adac79c to your computer and use it in GitHub Desktop.
crawler_algorithm.rb
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