[smolder grant] progress update

mpeters on 2007-05-20T16:31:25

I found some time this weekend to do some more work on my TPF grant to improve Smolder. I'll be doing a presentation to the Raliegh Perl Mongers on Smolder the first week of June, so I'll need to find some more time pretty soon too. Plus I'll need to definitely finish this round of work before YAPC and OSCON.

The first milestone (ditching the old XML format for plain TAP) is now feature complete (with tests of course). The accepted format is now a TAR archive containing TAP files with one YAML file with META information about the test run. To see more documentation see http://smolder.svn.sourceforge.net/viewvc/smolder/trunk/docs/upload_file_format.pod?view=markup.

The next 2 milestones have to do with setting up a system to easily automate CPAN style distributions for automatic testing from svn, etc. I've put this off for a few days but will get to it soon.

The 4th milestone was to add project specific RSS feeds. I was originally planning on using XML::RSS, but I've decided to go a simpler route. I don't need to parse RSS or do anything fancy other than emit XML using RSS tags. Using a template would be much easier. It also means I don't need to include the dependencies of XML::RSS inside of Smolder either, so it's that much smaller.

This milestone is now feature complete as well. That just leaves 2 left.


How about XML::Atom::SimpleFeed?

Aristotle on 2007-05-21T02:26:50

First – please, please emit Atom, not RSS. It is much better tech than RSS 2.0, and just as widely supported. If you’re writing new code to consume feeds, you need to support both formats (and more besides), but if you’re writing new code to produce feeds, there’s no technical reason to emit anything but Atom.

As for generating XML using templates: that isn’t difficult if you know what you’re doing, but there is a whole host of niggly little issues that you need to be aware of to do it really correctly. There’s more to it than just gluing strings together, and much of it is hairsplitting, but important hairsplitting. Do yourself a favour and don’t use string interpolation to generate XML.

XML::Atom::SimpleFeed (disclaimer: I’m the maintainer) gives you both of these. It provides a very simple API for generating Atom feeds, and it’s very lightweight: it doesn’t have any non-core dependencies because it generates feeds only, and because Atom is sane, which makes generation easy.

Re:How about XML::Atom::SimpleFeed?

mpeters on 2007-05-21T20:36:21

First – please, please emit Atom, not RSS. It is much better tech than RSS 2.0, and just as widely supported.

I understand that people are pretty opinionated on the RSS vs Atom debate (and there may be a "right" side... I admit to not having followed it too closely), but RSS is simply more recognized as a term for a data feed. I have no problems with emitting both though.

As for generating XML using templates: that isn’t difficult if you know what you’re doing, but there is a whole host of niggly little issues that you need to be aware of to do it really correctly. There’s more to it than just gluing strings together, and much of it is hairsplitting, but important hairsplitting. Do yourself a favour and don’t use string interpolation to generate XML.

I'm not using "string interpolation" but rather Template Toolkit, which Smolder already uses for it's HTML output. I'm doing the normal character escaping that's needed for XML. And since I'm not using any binary data or anything other than simple text and urls I don't need to worry about CDATA or any other hairy things.

Unless there's something else I'm missing, I think I'll stick with the simplest approach that solves my problem. Plus, going with the templated approach means that I can emit Atom or RSS just by using a different template.

Re:How about XML::Atom::SimpleFeed?

Aristotle on 2007-05-21T20:56:56

RSS is simply more recognized as a term for a data feed

Sure. So just call the Atom feed “RSS”. Nobody will notice, and those who do won’t care. (I sure won’t.) Works for “Kleenex”.

I can emit Atom or RSS just by using a different template

The devil is in the “just” – writing a different template is no easier than writing code to use another module.

Btw, if you choose to take the template route, you’ll still want to pick Atom – it’s easier to generate.

Re:How about XML::Atom::SimpleFeed?

mpeters on 2007-06-16T16:50:00

Alright I'm convinced. It doesn't make much sense to emit both RSS and Atom, so I went with Atom after doing a little reading comparing the 2. And since XML::Atom::SimpleFeed is so small, and didn't have any dependencies other than Carp::Clan I went ahead and used it instead of doing a templated approach.

Thanks for the heads up about both points.

Re:How about XML::Atom::SimpleFeed?

Aristotle on 2007-06-16T17:51:31

Oh yeah, Carp::Clean; forgot about that. That will be going away in the next release too. :-)