¶ ↑
Flickr ThumbnailsA 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 searchTo 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 userTo 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" />
¶ ↑
AttributesSee 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!
¶ ↑
License(The MIT License)
Copyright © 2009 Rob Cameron
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.