Skip to content

Instantly share code, notes, and snippets.

@arashbm
Created July 18, 2012 05:00
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 arashbm/3134319 to your computer and use it in GitHub Desktop.
Save arashbm/3134319 to your computer and use it in GitHub Desktop.
Download all railscasts.com videos
require 'nokogiri'
require 'open-uri'
# Downloads all free railscasts.com screencasts in current directory
# just `ruby all.rb` and you're done
# if you want another format change it from m4v at the end of line 11
(202..360).each do |i|
puts i
doc = Nokogiri::HTML(open("http://railscasts.com/episodes/#{i}"))
doc.css('//a').each do |a|
system("wget -c -t0 --timeout=2 #{a['href']}") if a['href'] =~ /.+m4v$/
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment