Class: Macaron::Crawler
- Inherits:
-
Job
- Object
- Job
- Macaron::Crawler
- Includes:
- Observable
- Defined in:
- lib/macaron/crawler.rb
Instance Method Summary collapse
Instance Method Details
#run ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/macaron/crawler.rb', line 9 def run url, bot = @args page = Page.new(url, bot) links = [] begin links = page.fetch.inner_links rescue end changed notify_observers(links) print "#{url} >> #{page.title}\n" delete_observers end |