Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
flickr = FlickRaw::Flickr.new
photos = flickr.interestingness.getList(per_page: ARGV[0])
photos.each do |photo|
photo_url = flickr.photos.getSizes(photo_id: photo.id)[-1].source
photo_format = photo_url.split('.').last
photo_file = "~/Photos/Wallpapers/flickr/#{photo.title}#{photo_format}"
File.open(photo_file, "wb") do |f|
open(photo_url, "rb") do |ph|
f.write(ph.read)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.