Created
July 12, 2010 21:08
-
-
Save cbfrance/473059 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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'flickraw' | |
# via http://www.valibuk.net/2010/03/access-flickr-with-ruby-and-flickraw/#comment-158964 | |
id = "11104587@N07" | |
flickr.photos.search(:user_id => id) | |
puts "Your user ID is #{id}" | |
flickr.photos.search(:user_id => id, :tags => 'swift').each do |p| | |
info = flickr.photos.getInfo(:photo_id => p.id) # retrieve additional details | |
# p info | |
title = info.title | |
square_url = FlickRaw.url_s(info) | |
original_url = FlickRaw.url_o(info) | |
taken = info.dates.taken | |
views = info.views | |
tags = info.tags.map {|t| t.raw} | |
puts "<html>" | |
puts "Photo #{title} with #{views} views and tags #{tags.join(",")}" | |
puts "was taken on #{taken}, see it on #{square_url}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment