Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
a javascript flickr search module
JavaScript Racket
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README
flickrfindr.js

README

A JavaScript module for searching Flickr, for standalone
and require.js use

- Mike "Pomax" Kamermans

-----------------------------------------------------------
Quick example pending real documentation:
-----------------------------------------------------------

  var flickrFindr = FlickrFindr({
    // required API key
    api_key: "abcdefghijklmnopqrstuvwxyz",

    // the html to inject results into
    template: loadTemplateFrom("template.html"),

    // filtering parameters:
    filters: {
      license: "1,2,3,4,5,6", // CC-BY(-*) images
      content_type: 1,        // no screenshots
      media: "photos"         // photos, not video
    }
  });
  
  /**
   * what to do when there's search results
   */
  var showResults = function(finder) {
    var contentPane = $("div.images", finder.template),
        entry, href, link, i, last=finder.entries.length;
    for(i=finder.lastCount; i<last; i++) {
      entry = finder.entries[i];
      link = document.createElement("span");
      link.appendChild(entry.img);
      link.title = entry.title;
      contentPane.append(link);
    }
    finder.moreOnScroll = true;
  };

  /**
   * bind show function as callback for "more results were
   * retrieved" event
   */
  flickrFinder.setCallback(showResults);

-----------------------------------------------------------
For a vanilla template and .css styling, check out the
gh-pages branch, which contains flickrfindr.css and
flickrfinder_template.html files.
-----------------------------------------------------------

Demonstrator: http://pomax.github.com/FlickrFindr/

-----------------------------------------------------------
Something went wrong with that request. Please try again.