Several months ago I needed a way to keep my "blogroll" (list of RSS feeds I read, as seen on the side of my blog index page) up to date. Luckily, my news aggregator kept all the information in an OPML file called myChannels.opml. All I needed to do was extract the relveant information, sort it, spit out some HTML that can be included via SSI or PHP, and set it up to run from cron so that I don't have to think about it.
So I spent a few minutes on the problem and hacked out opml2html.pl. It's simple but does the job for me. Simply feed it an OPML file on STDIN and it'll spit back the XHTML code on STDOUT. That means you can run it like this: opml2html.pl < foo.opml > bar.html
A while back someone asked me how it I did this, so I sent the script. A few days ago, fellow Yahoo Michael Radwin asked how I did it. I sent him the script too. It turns out that his aggregator also produces a useful OPML file. He sent back patch today that improved it. That was enough to convince me that it's probably useful enough to share.
If someone is willing to patch your code, odds are good that several others are willing to use it.
Posted by jzawodn at December 26, 2002 02:51 PM
Jeremy: I did something similar with XSLT for my subscription OPML on Radio.
I admit your perl is tighter than my XSLT...
<plug>
Another XSLT solution to this, with integrated subscription links, is at http://purl.org/net/syndication/subscribe/.
See for example Jay Han's list at this address.
</plug>
I've been meaning to do this for ages and ages, but never quite crossed the laziness threshold :) I just set this up with my iBook, to rsync an HTML rendering of my AmphetaDesk subscriptions every few hours. I think it needs quite a bit of tweaking before it doesn't look like complete crap :)
(oh, in case I didn't make much sense: what looks like crap is my site, not the script :) )
Here's a bit of Python code by Phillip Pearson that'll do the blogrolling trick as well.
I was inspired by your efforts to do a blogroll in OPML, but I ended up writing a Template Toolkit plugin for MT to do it :)