Skip to content

Instantly share code, notes, and snippets.

@wfarr
Created May 8, 2012 17:52
Show Gist options
  • Save wfarr/2637940 to your computer and use it in GitHub Desktop.
Save wfarr/2637940 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'nokogiri'
require 'open-uri'
base_url = 'http://bukk.it/'
doc = Nokogiri::HTML(open(base_url))
doc.css('tr td a').each do |element|
path = element.attributes['href'].value
puts "Downloading #{path}..."
File.open("#{ENV['HOME']}/Pictures/Very Important Documents/#{path}", "wb") do |file|
file.write open(base_url + path).read
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment