Skip to content

Instantly share code, notes, and snippets.

@chrismealy
Created May 8, 2012 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrismealy/2639382 to your computer and use it in GitHub Desktop.
Save chrismealy/2639382 to your computer and use it in GitHub Desktop.
feedzirra_typhoeus_example
require 'feedzirra'
require 'typhoeus'
f = Feedzirra::Feed.fetch_and_parse('http://krugman.blogs.nytimes.com/feed/')
urls = f.entries.map &:url
h = Typhoeus::Hydra.new
urls.map do |url|
r = Typhoeus::Request.new(url)
r.on_complete {|rsp| puts rsp.body[400..500] }
h.queue(r)
end
h.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment