Created
December 19, 2008 01:20
-
-
Save toolmantim/37748 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Downloads all the photos from a flickr set | |
require 'open-uri' | |
require 'rubygems' | |
require 'flickr-rest' # benschwarz-flickr-rest | |
Flickr::Query::API_KEY = 'your key, yo.' | |
Flickr::Query.new('57794886@N00'). | |
execute('flickr.photosets.getPhotos', :photoset_id => '72157609406563810').search('photo').each do |photo| | |
unless File.exist?(filename = "/tmp/#{photo['id']}.jpg") | |
open(filename, "w+") do |f| | |
f.write open("http://farm#{photo['farm']}.static.flickr.com/#{photo['server']}/#{photo['id']}_#{photo['secret']}_o.jpg").read | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment