| d2r diego's weblog |
now with Atom support: java google feeds bridgeAfter last week's experiment of a Google-RSS bridge in Java, I took the next step and decided to check out how hard it was to generate a valid Atom feed as well. The result is an update on the Google bridge page and new code. The idea, as before, was to write code that could generate valid feeds with as little dependencies as possible (It might even be considered a quick and dirty solution). For reference I re-checked the Atom Wiki as well as Mark's prototype Atom 0.2 feed. In the end, it worked. Adding support for Atom begged for some generalization and refactoring (which I did) but aside from that adding Atom support took a few minutes. Here are some notes:
Is it bad that Atom would need something like a tutorial? Probably. Is it too high a price to pay? Probably not. After all, more strict guidelines for the content are good for reader software. I thought "maybe if there's a way to create a simple feed without all the content-type stuff..." but then everyone would do that, and ignore the rest, wouldn't they. Of course, maybe I misunderstood the whole issue... comments and clarifications on this area would be most welcome. I guess there's no silver-bullet solution to this. The price of more strict definitions is loss of (some) simplicity. The comparison between a language with weak typing (say LISP) and one with strong typing (say, Java) comes to mind when comparing RSS and Atom in this particular sense. I think that I would go with RSS when I can, since it will be more forgiving... on the other hand I do like strong typing. But should content be "strongly typed"? I'll have to think more about this. Interesting stuff nevertheless. PS: there's a hidden feature for the search. It's a hack, yes. It might not work forever. Still worth checking the code for it though :-) Categories: soft.devPosted by diego on September 5 2003 at 10:26 PM Comments (please see the comments & trackback policy).
Don't panic! ;-) 1. Re: ISO dates. Having looked at the validation results of a large number of feeds, it is my opinion that ISO dates are easier to generate *correctly*. If you look at somebody else's feed and copy what you see, you are likely to get it right. This isn't quite so with RFC 822, particularly if you are outside of the US. The primarly problem area is the limited number of time zones defined in the RFC. I also note that your existing RSS feeds are 1.0, and use this format. 2. The tagging of the content is intended to make you think. It turns out that some people put text/plain descriptions out there. Others include html. Some escape. Some do it literal. Many will yell *do it my way*. My thoughts are that this is a lost cause. Do it *your* way. Just take a moment to tell me what way you chose. Without these attributes, consumers are forced to guess. 3. Both RSS 1.0 and 2.0 allow dc:creator or managingEditor or author on channel or items. What Atom does is require that at least one is present. And finally, all this will be captured in a consumer friendly manner before Atom goes 1.0. Posted by: Sam Ruby at September 6, 2003 3:05 AMUnless I'm missing something the RFC is horrible. And broken. The ISO, OTOH, is fine on the date front if rather less so on the time front. All date formats are a pain, its a statement of existence (-: Mind you generating them now appears to be trivial (given that my weapon of choice is currently .NET!!) Copyright © Diego Doval 2002-2007.
|
