Skip to content

Instantly share code, notes, and snippets.

@mdeiters
Created June 11, 2010 16:51
Show Gist options
  • Save mdeiters/434744 to your computer and use it in GitHub Desktop.
Save mdeiters/434744 to your computer and use it in GitHub Desktop.
require 'hpricot'
require 'open-uri'
railscasts_path = File.join(Rails.root, 'tmp', 'railscasts')
FileUtils.mkdir_p(railscasts_path)
feed = Hpricot(open("http://feeds.feedburner.com/railscasts"))
feed.search('enclosure') do |enclosure|
puts "Downloading: #{enclosure[:url]}"
`cd #{railscasts_path} && wget #{enclosure[:url]}`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment