Saturday, February 21, 2009

Crude canine saves another planet

Some time back, I started off a planet for NGOs at ngoplanet.org based on rawdog, not long after planetkde's switch to rawdog. NGO Planet does rss, opml and blogs listing, just like planetkde, but takes a different route to do all that (and opinion is divided on whether that's for better or for worse :D).

Instead of using jriddel's rss plugin that powers planetkde (unfortunately, I could not install libxml2 on my hosting provider, which is needed by the rss plugin), it dumps each form of output just by using a different template for each. So, with a minor tweak to rawdog code, rss is dumped using a rawdog template like this and an itemtemplate like this.

For the blog listing, it takes in an additional config parameter called feeditemtemplate that specifies the template for generating the list of feeds. The same infrastructure is thereby used to dump both the blog listing and the opml output, using separate set of templates for opml and bloglist. The complete set of code changes is in this github repo.

I do feel that hacking on the templates is an easier and more powerful way to extend rawdog (though I do realize that the creator of rawdog thinks otherwise). On the downside, this requires rawdog to be run multiple times, once for each type of output, unlike how it's done with planetkde - that's probably fixable, though.
PS: A secondary purpose for this post is also to shamelessly bump NGO Planet itself :D, so if you know of any blogs about NGOs anywhere in the world, please tell them about NGO Planet.