Class: SpiderBot::Base
- Inherits:
-
Object
- Object
- SpiderBot::Base
- Defined in:
- lib/spider_bot/base.rb
Class Method Summary collapse
-
.auto(&block) ⇒ Object
execute method with command "spider start" and "spider crawl".
- .crawl(url, options = {}) ⇒ Object
Class Method Details
.auto(&block) ⇒ Object
execute method with command "spider start" and "spider crawl"
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/spider_bot/base.rb', line 8 def auto &block if defined?(BOTCONSOLE) klass = Class.new do def origin url, = {} @origin_url = url @origin_options = end def execute name = nil, &block crawl_instance = Crawl.new(@origin_url, @origin_options) crawl_instance.instance_eval &block end end klass.allocate.instance_eval &block end end |