public
Description: An extension for Radiant CMS which allows you to do a simple flickr search and return thumbnails for display on a page
Homepage:
Clone URL: git://github.com/cannikin/flickr_thumbnails.git
cannikin (author)
Mon Feb 16 18:32:00 -0800 2009
commit  3b10b382de372bbbe37aa54cd22df79c1bbcb1d8
tree    59f5f728805fd5441c2235bc0336eedd55a5bad3
parent  c5fbb6ec2f2245e851c14d8ffd4b78c90f8f2eb5
name age message
file .DS_Store Loading commit data...
file README.rdoc
file Rakefile
directory app/
file flickr_extension.rb
directory lib/
directory spec/
README.rdoc

Flickr Thumbnails

A simple tag that will pull photos from the Flickr api and display on your site in an unordered list. The list will show the thumbnail with alt text being the title of the photo, surrounded by a link to view the full photo on flickr.

Examples

Basic text search

To get the first 5 photos that match a search for "pizza":

  <r:flickr api_key="your_key_here" text="pizza" per_page="5" />

Where "your_key_here" is your Flickr API key. See flickr.com/services/api/keys/apply/ for info on getting yourself a key. These should be the same 5 photos as if you went to the flickr homepage and typed "pizza" into the search box.

The result of this search on your page looks like:

  <ul>
    <li><a href="http://flickr.com/photos/cannikin/3270587567"><img src="http://farm4.static.flickr.com/3450/3270587567_c9e7da5bb0_s.jpg" alt="IMG_2540" /></a></li>
    <li><a href="http://flickr.com/photos/cannikin/3270580733"><img src="http://farm4.static.flickr.com/3451/3270580733_6902475867_s.jpg" alt="All you can eat pizza!!!" /></a></li>
    <li><a href="http://flickr.com/photos/cannikin/3271396294"><img src="http://farm4.static.flickr.com/3311/3271396294_64e21d40ce_s.jpg" alt="Campbell, CA 95008" /></a></li>
    <li><a href="http://flickr.com/photos/cannikin/3270578745"><img src="http://farm4.static.flickr.com/3393/3270578745_fca7b33dba_s.jpg" alt="A year in the life of... Me! February 10th: Empty Wheelchair on a Tree" /></a></li>
    <li><a href="http://flickr.com/photos/cannikin/3271405472"><img src="http://farm4.static.flickr.com/3455/3271405472_d213fe350f_s.jpg" alt="IMG_2537" /></a></li>
  </ul>

Find photos from a particular user

To find only photos from a certain user (like yourself) that are tagged with a given word, you first need to find out your NSID. You can get that by entering your username here: www.xflickr.com/fusr/

Once you have that ID you can, for example, search only your own photos that are tagged with ‘waterfall’:

  <r:flickr api_key="your_key_here" user_id="12345678@N00" tags="waterfall" per_page="10" />

Attributes

See flickr.com/services/api/flickr.photos.search.html for a full list of attributes you can pass to the tag. All API arguments are available, just use the ones you want as attributes in your tag.

All attributes are optional except for api_key.

Enjoy!