Download RailsConf 2007 Presentations

Updated: Now more bloated!

Run this to get the RailsConf 2007 presentations:
#!/usr/bin/env ruby

require 'rubygems'
require 'hpricot'
require 'open-uri'

base = 'http://www.web2expo.com'
h = Hpricot(open("#{base}/pub/w/51/presentations.html"))

h.search('div .presentation > a[@href^="/presentations/rails2007/"]').each do |a|
  url = "#{base}#{a[:href]}"
  if File.exists?(File.basename(url))
    puts "skipping #{url}... already downloaded"
  else
    puts "downloading #{url}..."
    `wget --quiet #{url}`
  end
end
I might clean it up more later to name the files better and not use wget, but this was quick and easy... not to mention a way to use everyone's favorite parsing tool: Hpricot.

Posted by Lee Marlow Mon, 21 May 2007 18:27:00 GMT


Comments

  1. Dr J about 1 hour later:

    excellent!!

    wish I was in Portland for it

  2. Werner Ramaekers about 1 hour later:

    If you want to run this from a mac running OSX then replace :
    `wget —quiet #{url}`
    with :
    `curl —silent #{url}`

  3. Werner Ramaekers about 1 hour later:

    If you want to run this from a mac running OSX then replace :
    `wget —quiet #{url}`
    with :
    `curl -O —silent #{url}`

  4. Preston Lee about 3 hours later:

    Cool hack. I did something similar this morning, and am hosting a single .zip download which include stuff not present on the web2expo website..

    http://www.prestonlee.com/archives/117

  5. Preston Lee about 3 hours later:

    Cool hack. I did something similar this morning, and am hosting a single .zip download which include stuff not present on the web2expo website..

    http://www.prestonlee.com/archives/117