Difference between revisions of "Tag Search for Addicted to Flickr"

From rukapedia
Jump to: navigation, search
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
I wrote a [http://ruk.ca/code/class.flickr.php.patch small patch] for [http://addictedtonew.com/examples/flickr/ Addicted to Flickr] that adds support for the [http://www.flickr.com/services/api/flickr.photos.search.html flickr.photos.search] method.
 
I wrote a [http://ruk.ca/code/class.flickr.php.patch small patch] for [http://addictedtonew.com/examples/flickr/ Addicted to Flickr] that adds support for the [http://www.flickr.com/services/api/flickr.photos.search.html flickr.photos.search] method.
 +
 +
'''Note:''' There was a bug in the original patch (tagmode rather that tag_mode).  I've corrected this.
  
 
==How to Apply==
 
==How to Apply==
Line 9: Line 11:
 
The output from this should be something like:
 
The output from this should be something like:
  
<pre>patching file class.flickr.original.php</pre>
+
<pre>patching file class.flickr.php</pre>
  
 
This all assumes you're using a friendly OS X or Linux system; if you're running Windows, you're on your own.
 
This all assumes you're using a friendly OS X or Linux system; if you're running Windows, you're on your own.
  
===Examples of Use===
+
==Examples of Use==
 +
 
 +
The main [http://addictedtonew.com/examples/flickr/ Addicted to Flickr] site has plenty of examples; look at the [http://addictedtonew.com/examples/flickr/users/#getuserspublicphotos getUsersPublicPhotos example] and substitute in a call to the newly patched-in '''getTagSearchPhotos''' method, and you'll have a good start.  For example:
  
 
<pre>$result = $flickr->getTagSearchPhotos('','aircanada','all',1,15);</pre>
 
<pre>$result = $flickr->getTagSearchPhotos('','aircanada','all',1,15);</pre>

Latest revision as of 10:35, 9 March 2006

I wrote a small patch for Addicted to Flickr that adds support for the flickr.photos.search method.

Note: There was a bug in the original patch (tagmode rather that tag_mode). I've corrected this.

How to Apply

Download and save the patch, then copy it to the same directory where you've put class.flickr.php. Then:

patch class.flickr.php class.flickr.php.patch

The output from this should be something like:

patching file class.flickr.php

This all assumes you're using a friendly OS X or Linux system; if you're running Windows, you're on your own.

Examples of Use

The main Addicted to Flickr site has plenty of examples; look at the getUsersPublicPhotos example and substitute in a call to the newly patched-in getTagSearchPhotos method, and you'll have a good start. For example:

$result = $flickr->getTagSearchPhotos('','aircanada','all',1,15);

This will return the most recent 15 photos tagged 'aircanada'.

$result = $flickr->getTagSearchPhotos('','aircanada,airplane','all',1,15);

This will return the most recent 15 photos tagged 'aircanada' and 'airplane'.

$result = $flickr->getTagSearchPhotos('','charlottetown,london','all',1,15);

This will return the most recent 15 photos tagged 'charlottetown' or 'london'.