Created
May 8, 2012 17:52
-
-
Save wfarr/2637940 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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