Skip to content

Instantly share code, notes, and snippets.

@markbrown4
markbrown4 / downloader.rb
Created October 2, 2012 07:52
railscast downloader
require 'rubygems'
require 'nokogiri'
require 'open-uri'
doc = Nokogiri::HTML(open("http://railscasts.com/?type=free"))
total_pages = doc.css('.pagination a:nth-last-child(2)').inner_html.to_i
(1..total_pages).each do |i|
puts "PAGE #{i} ================================"