class Killshot::Crawler

Attributes

root[R]
whitelist[R]

Public Class Methods

new(root, whitelist) click to toggle source
# File lib/killshot.rb, line 12
def initialize(root, whitelist)
  @root      = root
  @whitelist = Set.new(whitelist)
end

Public Instance Methods

crawl(&block) click to toggle source
# File lib/killshot.rb, line 17
def crawl(&block)
  Anemone.crawl(root) do |anemone|
    anemone.on_every_page do |page|
      find_hotlinks(page) do |url, hotlink|
        block.call(url, hotlink)
      end
    end
  end
end

Private Instance Methods