Class: Killshot::Crawler
- Inherits:
-
Object
- Object
- Killshot::Crawler
- Defined in:
- lib/killshot.rb
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
-
#whitelist ⇒ Object
readonly
Returns the value of attribute whitelist.
Instance Method Summary collapse
- #crawl(&block) ⇒ Object
-
#initialize(root, whitelist) ⇒ Crawler
constructor
A new instance of Crawler.
Constructor Details
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
10 11 12 |
# File 'lib/killshot.rb', line 10 def root @root end |
#whitelist ⇒ Object (readonly)
Returns the value of attribute whitelist.
10 11 12 |
# File 'lib/killshot.rb', line 10 def whitelist @whitelist end |
Instance Method Details
#crawl(&block) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# 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 |