View on GitHub

Flickr objects

An object-oriented wrapper for the Flickr API.

Download this project as a .zip file Download this project as a tar.gz file

Setup

In your Gemfile:

gem "flickr-objects"

In your initializer:

Flickr.configure do |config|
  config.api_key = "API_KEY"
  config.shared_secret = "SHARED_SECRET"
end

Usage

Photos:

person_id = "78733179@N04"
person = Flickr.people.find(person_id)
photo = person.get_public_photos(:sizes => :all).first

photo.small!(320)
photo.width      #=> 320
photo.height     #=> 240
photo.source_url #=> "http://farm9.staticflickr.com/8191/8130464513_780e01decd_n.jpg"

Hana

photo.medium!(500)
photo.width      #=> 500
photo.height     #=> 375
photo.source_url #=> "http://farm9.staticflickr.com/8191/8130464513_780e01decd.jpg"

Hana

photo.description #=> nil
photo.get_info!
photo.description #=> "In waldorf camp."
photo.updated_at  #=> 2012-10-28 11:56:46 +0100

People:

person = Flickr.people.find("78733179@N04")
person.get_info!

person.username         #=> "janko-m"
person.real_name        #=> "Janko Marohnić"
person.has_pro_account? #=> false
person.budddy_icon_url  #=> "http://www.flickr.com/images/buddyicon.jpg"