Tuesday, March 01, 2005

Yahoo Image Search Collage Generator

Jeremy Zawodny announced the release of the Yahoo Search API a few days ago. I wanted to do something that uses the service. So, here is a quick Perl script that fires up a Yahoo! Image Search for the specified query text and displays the thumbnail images of the obtained search results in the form of a collage. The collage below was generated by saying:

yahoo_collage.pl --query flowers



You can specify the file which the collage should be written to by using the --file command-line option. For example: the following invocation of the script will query Yahoo for pictures of geeks and will write the collage to a file named geek.html.

yahoo_collage.pl --query geek --file geek.html

You can simply open geek.html in a Web Browser like Mozilla Firefox and view your collage later on.



You can download the source of the Perl script from here. I offer no guarantees, so if it breaks, you get to keep both pieces :-)


Update on March 03, 2005: I hacked the above script and generated a wallpaper after querying Yahoo Image Web Service on a set of keywords.





Check it out!