Skip to content

Instantly share code, notes, and snippets.

@robertjwhitney
Created February 3, 2011 17:17
Show Gist options
  • Save robertjwhitney/809801 to your computer and use it in GitHub Desktop.
Save robertjwhitney/809801 to your computer and use it in GitHub Desktop.
simple script to download an array of images over http
require 'net/http'
require 'yaml'
files = YAML.load_file("image_list.yml")
i = 1
files.each do |file|
# use root url without protocol
response = Net::HTTP.start("farm5.static.flickr.com") do |http|
http.get("#{file}")
end
puts "#{response}"
File.open("#{i}.jpg", "w").write(response.body)
i += 1
end
---
- /4130/5020404434_1522d34a0b.jpg
- /4087/5395859868_953025d4ee_m.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment