Sha256: fad0be64cf8bd5afc8bdd56fc4d9a94a3fadd6e60ee14d50a2aaa17254b6df20

Contents?: true

Size: 567 Bytes

Versions: 2

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'
require 'rdoc/usage'

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

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


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
anemone-0.0.1 bin/anemone_count.rb
anemone-0.0.2 bin/anemone_count.rb