Created
November 18, 2013 02:17
-
-
Save gdisneyleugers/7521369 to your computer and use it in GitHub Desktop.
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
| require 'anemone' | |
| require 'redis' | |
| require 'uuidtools' | |
| redis = Redis.new(:host => "localhost", :port => 6379) | |
| puts "URL to crawl: " | |
| url = gets | |
| Anemone.crawl(url) do |anemone| | |
| anemone.on_every_page do |page| key=UUIDTools::UUID.random_create | |
| puts key | |
| puts page.url | |
| redis.set(key, page.url) | |
| redis.get(key) | |
| end | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment