Files
metasploit-gs/lib/anemone/cli/count.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
389 B
Ruby
Raw Normal View History

2010-11-06 04:34:43 +00:00
require 'anemone'
begin
# make sure that the first option is a URL we can crawl
url = URI(ARGV[0])
rescue
puts <<-INFO
Usage:
anemone count <url>
Synopsis:
Crawls a site starting at the given URL and outputs the total number
of unique pages on the site.
INFO
exit(0)
end
Anemone.crawl(url) do |anemone|
anemone.after_crawl do |pages|
puts pages.uniq!.size
end
end