Created
September 26, 2009 23:55
-
-
Save queso/194514 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def run | |
return if @bot.blank? | |
@bot.feeds.each do |feed| | |
next if feed.uri.blank? | |
DaemonKit.logger.info "Parsing feed #{feed.uri} for #{@bot.username}" | |
Feed.new(feed.uri) do |parsed_feed| | |
parsed_feed.sanitize! | |
entries = parsed_feed.tweetable_entries | |
entries.each do |entry| | |
tweet_entry(feed, entry) | |
end | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
amq.queue('jobs').subscribe( :ack => true ) do |info, msg| | |
safely do | |
job = Marshal.load(msg) | |
actual_job = job[:type].constantize.send(:new, job[:id]) | |
actual_job.run { info.ack } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment