Sha256: 65b65e53064cda15e3c4e0be213c7d1be8098287d85af79185a827845e8c5a23
Contents?: true
Size: 1.03 KB
Versions: 1
Compression:
Stored size: 1.03 KB
Contents
require 'ostruct' require 'anemone/core' module Anemone # Version number VERSION = '0.1.2' #module-wide options def Anemone.options=(options) @options = options end def Anemone.options @options end # # Convenience method to start a crawl using Core # def Anemone.crawl(urls, options = {}, &block) Anemone.options = OpenStruct.new(options) #by default, run 4 Tentacle threads to fetch pages Anemone.options.threads ||= 4 #disable verbose output by default Anemone.options.verbose ||= false #by default, don't throw away the page response body after scanning it for links Anemone.options.discard_page_bodies ||= false #by default, identify self as Anemone/VERSION Anemone.options.user_agent ||= "Anemone/#{self::VERSION}" #no delay between requests by default Anemone.options.delay ||= 0 #use a single thread if a delay was requested if(Anemone.options.delay != 0) Anemone.options.threads = 1 end Core.crawl(urls, &block) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
anemone-0.1.2 | lib/anemone/anemone.rb |