Skip to content

Instantly share code, notes, and snippets.

@cbfrance
Created July 12, 2010 21:08
Show Gist options
  • Save cbfrance/473059 to your computer and use it in GitHub Desktop.
Save cbfrance/473059 to your computer and use it in GitHub Desktop.
#!/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