Class: Tweetlr::Core
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args) ⇒ Core
constructor
A new instance of Core.
Methods included from LogAware
Constructor Details
Class Method Details
.crawl(config) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/tweetlr/core.rb', line 23 def self.crawl(config) log.debug "#{self}.crawl() using config: #{config.inspect}" twitter_config = prepare_twitter_config config tumblr_config = prepare_tumblr_config config twitter_config[:search_term] = URI::escape(twitter_config[:search_term]) if twitter_config[:search_term] log.info "starting tweetlr crawl..." response = {} response = Tweetlr::Processors::Twitter::lazy_search(twitter_config) if response process_response response, config # store the highest tweet id config[:since_id] = response['max_id'] else log.error "twitter search returned no response. hail the failwhale!" end log.info "finished tweetlr crawl." return config end |