Skip to content

Instantly share code, notes, and snippets.

@r3bo0t
Created September 16, 2010 09:24
Show Gist options
  • Save r3bo0t/582173 to your computer and use it in GitHub Desktop.
Save r3bo0t/582173 to your computer and use it in GitHub Desktop.
Crawler for downloading rails-cast videos
require 'rubygems'
require 'hpricot'
require 'open-uri'
class GetRailsCasts
def initialize
@host = "http://railscasts.com/episodes/"
end
def start
1.upto(231){ |eps|
@esp = Hpricot(open("#{@host}#{eps}")) rescue nil
if @esp
`cd /path/to/your/dir; wget #{(@esp/".download/a").first[:href]}`
end
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment