Created
March 26, 2015 21:46
-
-
Save bfolkens/7f27b42d2ec1f28ccf3b 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
#!/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