Flickrrb

Flickrrb is a nice library to access the flickr api in a simple way. It maps the methods described in the official api documentation to ruby methods, eg.

flickr.people.findByUsername(:username => ‘Henry Maddocks’)

flickr.photos.getInfo(:photo_id => photo)

You can copy from the documentation and paste into your ruby.

Installation

gem install flickrrb

Usage

input = IO::popen('pbpaste').read

# matches the photo id eg 3249240923
# or the url eg http://www.flickr.com/photos/jump_leads/3249240923/
photo_id = input.match('/?(\d+)/?$')[1]

flickr = Flickr.new :api_key => "xxxx", :debug => true
sizes = flickr.photos.getSizes(:photo_id => photo_id)

sizes.each do |s|
  p "#{s.label} - #{s.source}"
end

Todo

  • OAuth.