Now blogging at diego's weblog. See you over there!

a google-rss bridge in java

I've been experimenting with the Google API for an upcoming Google-query feature in clevercactus and I thought that it would be cool to show how simple is to generate RSS 2.0 feeds (which validate) from within Java based on the Google query results, using only JAXP and SAX, which come built-in with JDK 1.4. (Incidentally, if you haven't checked the RSS spec recently I recommend another look, there have been a few --but key-- clarifications and improvements made to it in the past few weeks).

The result is Google RSS Feeds which is a simple (emphasis on simple :-)) web service using pure Servlets that generates an RSS feed based on a query. (The feed generation is encapsulated in a separate class though, so it can be reused in other contexts). The whole thing took about an hour to write, package and deploy. Not bad. :)

The page linked above is an example of the service working; and since the idea of all of this is to provide a sort of "code-tutorial" for Java, the sources are also available, provided under a simple (again!) open source license that allows modification and redistribution, both in source and binary forms, as long as the original copyright notice is maintained.

As always, comments (and in this case, improvements!) are most welcome.

Enjoy! :-)

Posted by diego on August 30 2003 at 1:04 AM

Copyright © Diego Doval 2002-2011.
Powered by
Movable Type 4.37