Flickr on rails

Hi all,

I’m currently trying to use rails to connect with my flickr photos so
i can display them on my site. Ive used the screencast on
rubyonrails.org and completed it. Ive also gone through all the
troubles of the hardcoded API key which has expired too.

So far my application is working, when i type in a tag to search for
it brings back photos, but they aren’t mine! Is it just me being
stupid or does the API key mean that i will be searching my photos, or
does the API key give me access to everyones photos?!

Because im looking to build an application that just searches my
photos?! Any help would be appreciated!

Hi Matt.

On 4 Sep 2007, at 21:55, matt wrote:

Ive also gone through all the
troubles of the hardcoded API key which has expired too.

Tough one that, took me a few goes to figure out why my key wasn’t
being used.

So far my application is working, when i type in a tag to search for
it brings back photos, but they aren’t mine! Is it just me being
stupid or does the API key mean that i will be searching my photos, or
does the API key give me access to everyones photos?!

The API key is only a key to the API, it allows you to use it’s
methods, and for flickr to identify who is using their services.

Unfortunately it is not flickr.rb that is at fault, the Flickr API
(Flickr Services) does not provide a way to
search your own photos.

Because im looking to build an application that just searches my
photos?! Any help would be appreciated!

All i can really suggest is caching a local copy of your photo
metadata, maybe running a cron task once in a while to keep this
updated.

You can get all of your photos as follows…

flickr = Flickr.new
user - flickr.users(‘yourusername’)
first_500_photos = user.photos 500 # limit of 500 on this.
second_500_photos = user.photos 500, 2

etc

A quick search run on this using acts_as_indexed or acts_as_ferret
will produce faster results, that should be as up-to-date as the last
time you ran your cron update.

It’s worthwhile understanding what flickr.rb does, and comparing this
to the API, as it will allow you to modify it to get the information
you need (title, description, tags etc) in one request rather than
several.

I hope this helps.

Douglas F Shearer
[email protected]

Great Post.I like the link.Now expecting some good ideas from your

upcoming post
http://www.dealsourcedirect.com/ion-tape2pc.html