Sha256: 5f2441c24e7a0eac7303cb87fc8d999bc07ec50799264c5fa16e2d87b36903d2

Contents?: true

Size: 390 Bytes

Versions: 7

Compression:

Stored size: 390 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

7 entries across 7 versions & 3 rubygems

Version Path
spk-anemone-0.3.0 lib/anemone/cli/count.rb
anemone-0.3.0 lib/anemone/cli/count.rb
spk-anemone-0.2.4 lib/anemone/cli/count.rb
shingara-anemone-0.2.4 lib/anemone/cli/count.rb
anemone-0.2.3 lib/anemone/cli/count.rb
anemone-0.2.2 lib/anemone/cli/count.rb
anemone-0.2.1 lib/anemone/cli/count.rb