Thursday, July 26, 2007

Blog Hack: Custom Flickr Search for your Blog







Would you like to add a custom flickr search box for your blog that only searches your photos? I found some html code you can add to your site to make a custom search box for your blog that searches only photos with your flickr username. I'll share with you how to do this for your site.



After reading my article on tagging photos & uploading to flickr with iTag, A reader asked me if I knew of a way to add a custom search box to your site that allows visitors to search only the pictures you uploaded to Flickr. The short answer was no, but I did some looking around and found the html code to make your own search box to search only your photos on flickr.


Here's How To Make Your Own Flickr Search:
1. First you will need your "raw" flickr ID#. This is the ID that is a string of characters, not your human-readible flickr name like evansfam. For example, my "raw" ID# is 94336434@N00. To find your "raw" Flickr ID # go to Flickr People Info Finder and you will see your ID# listed along with several other things flickr tracks.


2. Now you are ready for the code. Take the following code and change the "raw" ID #96395704@N00 to your own ID that you just found in step #1:


<!-- Search flickr -->
<p>Search all of Geek Tonic's photos for:
<form method=GET action="http://www.flickr.com/search/" target="_blank">
<input type=hidden name=w value="94336434@N00">
<input type=hidden name=m value="text">
<input type=text name=q size=25 maxlength=255 value="">
<input type=submit value="Flickr Search">
</form>
<!-- Search flickr -->

3. The default is to search for text (description and/or name), but you can change the value of m to "tags" instead of "text" if you want the search to only search your tags instead of doing a full-text search


4. Now insert the code into your site. That's it!
Now when you type in a search term into the box, it will search for that text in the description, titles and tags of your photos on flickr. All results will open up in a new window on the flickr page.

The end result is a nice, custom flickr search box just for your site. Here's how it should look:

(NOTE: THIS IS ONLY A SCREENSHOT - TO TRY THE CUSTOM SEARCH OUT ON THIS SITE, GO TO THE TOP-RIGHT OF THIS BLOG FOR THE SEARCH BOX.
via FlickrHacks Forum thanks to Dave Ward


For a complete listing of flickr hacks and tools CLICK HERE