Sha256: 85a9028ff622b06b11cc686d6c530a4f853e1fd1955d5bf5b8329303c08b056d

Contents?: true

Size: 389 Bytes

Versions: 17

Compression:

Stored size: 389 Bytes

Contents

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

Version data entries

17 entries across 17 versions & 4 rubygems

Version Path
sutch-anemone-0.7.2.2 lib/anemone/cli/count.rb
sutch-anemone-0.7.2.1 lib/anemone/cli/count.rb
sutch-anemone-0.7.2 lib/anemone/cli/count.rb
rodneyc-anemone-0.7.1.3 lib/anemone/cli/count.rb
rodneyc-anemone-0.7.1.2 lib/anemone/cli/count.rb
rodneyc-anemone-0.7.1.1 lib/anemone/cli/count.rb
anemone-0.7.2 lib/anemone/cli/count.rb
anemone-0.7.1 lib/anemone/cli/count.rb
anemone-0.7.0 lib/anemone/cli/count.rb
anemone-0.6.1 lib/anemone/cli/count.rb
anemone-0.6.0 lib/anemone/cli/count.rb
anemone-0.5.0 lib/anemone/cli/count.rb
spk-anemone-0.4.0 lib/anemone/cli/count.rb
anemone-0.4.0 lib/anemone/cli/count.rb
anemone-0.3.2 lib/anemone/cli/count.rb
spk-anemone-0.3.1 lib/anemone/cli/count.rb
anemone-0.3.1 lib/anemone/cli/count.rb