Created
July 18, 2012 05:00
-
-
Save arashbm/3134319 to your computer and use it in GitHub Desktop.
Download all railscasts.com videos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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