Skip to content

Instantly share code, notes, and snippets.

@anildigital
Created December 1, 2008 06:25
Show Gist options
  • Save anildigital/30656 to your computer and use it in GitHub Desktop.
Save anildigital/30656 to your computer and use it in GitHub Desktop.
# Confreaks - RubyConf2008 Videos downloader script
#
# Author: Anil Wadghule
#
require 'open-uri'
files_path = "http://rubyconf2008.confreaks.com/videos/"
downloadable_file_name_array = []
data = Net::HTTP.get(URI.parse(files_path))
data.each do |line|
split_string_array = line.split('"')
download_file_name = split_string_array[1]
if download_file_name and download_file_name.include?("-small")
downloadable_file_name_array << download_file_name
end
end
downloadabled_file_name_array = downloadable_file_name_array.sort
for each_file_name in downloadabled_file_name_array
downloadable_full_path = files_path + each_file_name
puts downloadable_full_path
puts system("wget #{downloadable_full_path}")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment