b3cc6e19b6
git-svn-id: file:///home/svn/framework3/trunk@10924 4d416f70-5f16-0410-b530-b9f4589650da
23 lines
389 B
Ruby
23 lines
389 B
Ruby
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
|