Created
July 3, 2012 13:44
-
-
Save themusicman/3039769 to your computer and use it in GitHub Desktop.
Checks a site for links that lead to 404 pages
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
source "http://rubygems.org" | |
gem 'anemone' |
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
require "rubygems" | |
require "bundler/setup" | |
require "anemone" | |
Anemone.crawl("http://example.com") do |anemone| | |
anemone.on_every_page do |page| | |
if page.code == 404 | |
puts 'oops! ' + page.url | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment