Code Monkey home page Code Monkey logo

flickr_thumbnails's Introduction

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!

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.

flickr_thumbnails's People

Contributors

cannikin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

emptyflask

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.