Skip to content

Instantly share code, notes, and snippets.

@kjell
Forked from gilesbowkett/ruby_conf_vids.rb
Created December 2, 2008 04:12
Show Gist options
  • Save kjell/30987 to your computer and use it in GitHub Desktop.
Save kjell/30987 to your computer and use it in GitHub Desktop.
require "rubygems"
require "hpricot"
require "open-uri"
url = "http://feeds.feedburner.com/Rubyconf2008-Confreaks"
(Hpricot(open url)/:enclosure).map {|x| x.attributes["url"]}.uniq.each do |vid|
filename = vid.gsub(/http:.+\//, '')
filename.gsub!(/-/, "_")
next if File.exist?(filename)
puts "Downloading #{vid}"
puts filename
`curl -L #{vid} > #{filename}`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment