Skip to content

Instantly share code, notes, and snippets.

@gilesbowkett
Forked from shayarnett/ruby_conf_vids.rb
Created December 5, 2008 08:05
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 gilesbowkett/32283 to your computer and use it in GitHub Desktop.
Save gilesbowkett/32283 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|
# File.exist?(vid.split("/").last) ? next : `curl #{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