flickr-fu gem

Gem details

flickr-fu is a ruby interface around the flickr REST api

Websitehttp://github.com/commonthread/flickr_fu/tree/master Author Ben Wyrosdick Tags Flickr, photos

Documentation

Install the Gem:
gem install flickr-fu
require 'flickr_fu'

flickr = Flickr.new('flickr.yml')

photos = flickr.photos.search(:tags => 'beachball')

puts "found #{photos.size} photo(s)"

photos.each do |photo|
  puts photo.title
  puts photo.description unless [nil, ''].include?(photo.description)
  [:square, :thumbnail, :small, :medium, :large, :original].each do |size|
    puts "#{size}: #{photo.url(size)}"
  end
  puts "comments: #{photo.comments.size}"
  photo.comments.each do |comment|
    intro = "#{comment.author_name} says - "
    puts "#{intro}\"#{comment.comment.gsub("\n", "\n"+(" "*intro.length))}\""
  end
  puts "notes: #{photo.notes.size}"
  photo.notes.each do |note|
    puts "[#{note.x},#{note.y} ~ #{note.width}x#{note.height}] - \"#{note.note}\""
  end
  puts
  puts
end

Edit Gem | Back in time (1 older version) | Last edited by: scott, 5 months ago