Sha256: dedfb471ff2da3a7832038d345a2f2b69df05c7512c58a474a7fe1a7c389473f

Contents?: true

Size: 567 Bytes

Versions: 14

Compression:

Stored size: 567 Bytes

Contents

#! /usr/bin/env ruby
# == Synopsis
#   Crawls a site starting at the given URL, and outputs the total number
#   of unique pages on the site.
#
# == Usage
#   anemone_count.rb url
#
# == Author
#   Chris Kite

$:.unshift File.join(File.dirname(__FILE__), "..", "lib")

require 'anemone'

def usage
  puts <<END
Usage: anemone_count.rb url
END
end

# make sure that the first option is a URL we can crawl
begin
  URI(ARGV[0])
rescue
  usage
  Process.exit 
end

Anemone.crawl(ARGV[0]) do |anemone|
  anemone.after_crawl do |pages|
    puts pages.uniq.size
  end
end


Version data entries

14 entries across 14 versions & 4 rubygems

Version Path
chriskite-anemone-0.0.4 bin/anemone_count.rb
chriskite-anemone-0.0.5 bin/anemone_count.rb
chriskite-anemone-0.0.6 bin/anemone_count.rb
chriskite-anemone-0.1.0 bin/anemone_count.rb
jeremyf-anemone-0.1.3 bin/anemone_count.rb
parolkar-anemone-0.1.2 bin/anemone_count.rb
anemone-0.2.0 bin/anemone_count.rb
anemone-0.1.2 bin/anemone_count.rb
anemone-0.0.5 bin/anemone_count.rb
anemone-0.0.6 bin/anemone_count.rb
anemone-0.1.0 bin/anemone_count.rb
anemone-0.1.1 bin/anemone_count.rb
anemone-0.0.4 bin/anemone_count.rb
anemone-0.0.3 bin/anemone_count.rb