Using flickr.rb

Does anyone have any experience with using flickr.rb? Seems the only
thing which is documented for it is searching through your photos.

Anyway, all I’m trying to do is return a list of my 20 most recent
photos, but nothing seems to work.

doing this returns 100 photos for a given user (which takes all day to
load)

@flickr = Flickr.new ‘API KEY’
@user = @flickr.users(‘USERNAME’)
render :partial => “/posts/photo”, :collection => @user.photos

if I try to add options to @user.photos like (:per_page => 20) it
doesn’t work.

Any ideas?

Search through the mailing list archives for a post I made on flickr
APIs. There’s another API that’s less simple but more complete …

– G.

I had the same issue, I had to modify the flickr.rb code. Replace the
photos method in the User class with:

def photos(opts=Hash.new)
  opts['user_id'] = @id
  @client.people_getPublicPhotos(opts)['photos']['photo'].collect { 

|photo| Photo.new(photo[‘id’]) }
# what about non-public photos?
end

Then call it like this:

user.photos({‘per_page’=>6.to_s})

Make sure you pass the parameters as a Hash and the per_page value is a
string and not a numeric value otherwise you will get a FixNum
exception.

cheers,

scott


What’s an Intel chip doing in a Mac? A whole lor more that it’s ever
done in a PC.

My Digital Life - http://scottwalter.com/blog
Pro:Blog - http://scottwalter.com/problog
Snippets - http://snippets.scottwalter.com

----- Original Message ----
From: Damien T. [email protected]
To: [email protected]
Sent: Saturday, June 24, 2006 6:27:38 AM
Subject: [Rails] using flickr.rb

Does anyone have any experience with using flickr.rb? Seems the only
thing which is documented for it is searching through your photos.

Anyway, all I’m trying to do is return a list of my 20 most recent
photos, but nothing seems to work.

doing this returns 100 photos for a given user (which takes all day to
load)

@flickr = Flickr.new ‘API KEY’
@user = @flickr.users(‘USERNAME’)
render :partial => “/posts/photo”, :collection => @user.photos

if I try to add options to @user.photos like (:per_page => 20) it
doesn’t work.

Any ideas?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs