Skip to content

Instantly share code, notes, and snippets.

@bfolkens
Created March 26, 2015 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bfolkens/7f27b42d2ec1f28ccf3b to your computer and use it in GitHub Desktop.
Save bfolkens/7f27b42d2ec1f28ccf3b to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'open-uri'
require 'csv'
CSV.open('infile.csv') do |csv|
csv.each do |row|
url = row[0]
open(url) do |infile|
rootname = File.basename(url)
outfilename = File.join('out', rootname)
File.open(outfilename, 'wb') do |out|
out.write infile.read
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment