Last active
December 31, 2016 11:37
-
-
Save qoobaa/b14cf7ab71528e860dc819a34a6476ab 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 "open-uri" | |
require "fileutils" | |
open("attachments.csv").each do |line| | |
path, url = line.split(",", 2) | |
puts path | |
FileUtils.mkdir_p(File.dirname(path)) | |
open(path, "w") { |f| f.write(open(url).read) } unless File.exist?(path) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment