Skip to main content
  1. Blog Archive/

Fetching Railscasts with Hpricot

In the spirit of why’s original nostrils , I’ve made a small Hpricot script to fetch me a set of screencasts from Railscasts

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

from,to=* { |arg| arg.to_i }
( do |ep|
  doc = Hpricot(open("#{uri}#{ep}"))
  puts (doc/'')'a')['href']

Then invoke by

ruby railscasts_downloader.rb 15 20 | xargs -n1 wget
Nick Ludlam
Nick Ludlam
Software Developer and Prototyper in Mixed Media