Skip to content

Instantly share code, notes, and snippets.

@ys
Created November 11, 2012 17:25
Show Gist options
  • Save ys/4055593 to your computer and use it in GitHub Desktop.
Save ys/4055593 to your computer and use it in GitHub Desktop.
require 'open-uri'
require 'nokogiri'
conf_name = ARGV[0]
doc = Nokogiri::HTML(open("http://confreaks.com/events/#{conf_name}"))
`mkdir -p #{ENV['HOME']}/Movies/screencasts/confs/#{conf_name}/`
doc.css('a').select { |a| a['href'] =~ /videos/ }.map{ |a| a['href'] }.uniq.each do |link|
link = "http://confreaks.com#{link}"
doc_vid = Nokogiri::HTML(open(link))
doc_vid.css('a').select { |a| a['href'] =~ /large/ }.map{ |a| a['href']}.each do |link|
`wget -O #{ENV['HOME']}/Movies/screencasts/confs/#{conf_name}/#{/(.*)\/(.*)\?(.*)/.match(link)[2]} -v #{link}`
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment