Class: DaimonSkycrawlers::Crawler::Default
- Defined in:
- lib/daimon_skycrawlers/crawler/default.rb
Overview
The default crawler
This crawler can GET given URL and store response to storage
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#connection, #get, #initialize, #post, #prepare, #process, #setup_connection, #skipped?
Methods included from DaimonSkycrawlers::ConfigMixin
Methods included from LoggerMixin
Constructor Details
This class inherits a constructor from DaimonSkycrawlers::Crawler::Base
Instance Method Details
#fetch(url, message) {|data| ... } ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/daimon_skycrawlers/crawler/default.rb', line 11 def fetch(url, ) response = get(url) data = [url.to_s, response.headers, response.body] yield(*data) if block_given? storage.save(*data) schedule_to_process(url.to_s, ) end |