Search AOL Pictures with ATOM feeds

Enable the Subscriptions block here!

I found the fact that AOL Pictures offered an ATOM feed API was very interesting. I've pretty much always expected services to return something that needed further processing so I've tended to gravitate towards the JSON API. That thinking is probably a bit outdated...especially for web applications - since most, if not all browsers handle ATOM and XML these days. From an architectural perspective, feeds are really the epitome of REST, so I decided to take a look - here's an example of how we can create a simple global tag search for AOL pictures.

Here's a simple CGI program that takes a single parameter (you'll obvious want to add some error checking) and and returns an ATOM/XML feed. Note that I've used a different LWP module/library than my previous examples. If you're a fan of REST and PERL, then LWP is your best friend. Also as you might expect, the Content-type is changed as well.

#!/usr/bin/perl
use strict;
use LWP::Simple;
use CGI;

my $q = new CGI;
my $keyword = $q->param("keyword");
my $url = "http://pictures.aol.com/galleries/tags/$keyword/atom.xml";
my $content = get $url;

print "Content-type: application/atom+xml\n\n";
print "$content";
Now we just add a simple HTML form:
<html>
<body>
<form ACTION="foo.cgi">
Search AOL Pictures: <input type="text" name="keyword">
<input type="submit" value="Search">
</form>
</body>
</html>
And we get a nice global tag search result in ATOM format:

I think there's a lot of potential in AOL Pictures ATOM API. Feeds have become such a pervasive method for sharing and gathering data. What do you think?