Monthly Archives: August 2002

Cacheing on XSLT service

To speed things up on the experimental RSS-in-Mozilla-sidebar thingy, I’ve added in some cacheing (using a little MySQL db) to the simple XSL-Transform service that’s used to transform RSS to HTML on the fly, for inclusion into the sidebar. It makes it a lot faster, obviously, and takes a bit of strain off our poor old Celeron. I’ve exposed the gubbins a bit, in that it’s possible to specify a ‘cachelife’ parameter on the call. So if you want to customise the URL passed in the sidebar.addPanel() call, you can send this now:

http://www.pipetree.com/service/xslt ? xmlfile=http://url/of/rss.feed & xslfile=http://www.pipetree.com/~dj/rss.xsl & cachelife=30

The ‘cachelife’ parameter says “give me the cached version as long as it’s no more than N (30, here) minutes old … otherwise pull the RSS and transform it for me afresh, baby”. (It’s all explained briefly on a little homepage, which you get if you don’t specify an xslfile or xmlfile parameter.)

The existing sidebar button will continue to work fine, in that a default of 60 (minutes) is assumed if no ‘cachelife’ parameter is specified.

Sidebars, Mozilla, RSS: old and new

Back in the spring of 2000, I wrote MySidebar, a concoction of Mozilla sidebars, XUL and RSS. It allowed you to specify an RSS URL and would generate XUL from it and install it in Mozilla’s sidebar. (XUL involves RDF. The interconnectedness of all things, eh?)

Fozbaca recently pointed to something similar, which reminded me about the whole thing. I’ve just downloaded Mozilla 1.1, and decided to revisit the area. Things have changed – you can now plonk straight HTML into the sidebar, rather than have to use XUL. Mmmm.

So, I’ve had a bit of fun glueing ideas I read about from Mark and Jon. What I’ve ended up with is a Mozilla toolbar button that you can click while viewing a weblog that points to its own RSS feed. The button’s link is to Javascript, adapted from Mark’s auto-subscribe bookmarklet. On discovering an RSS feed (and the title of the blog page), it then constructs an XSLT pipeline URL that Jon demonstrated last month. The URL looks like this (split up for easy reading):

http://www.pipetree.com/service/xslt ? xmlfile=http://url/of/rss.feed &
  xslfile=http://www.pipetree.com/~dj/rss.xsl

The /service/xslt on pipetree is something very similar to the W3C XSLT Service that Jon used. I wrote my own for various reasons. It’s a lot simpler, and probably a lot dafter. The XSLT stylesheet specified is a very simple one which points to some even simpler CSS to make the RSS-rendered-into-HTML … small enough to fit in Mozilla’s sidebar, into which it goes with the call to sidebar.addPanel() at the end of the Javascript where all this pipelining started out.

It’s not that efficient, probably not that useful in the long run, but is certainly fun and allows me to turn my Mozilla into a sort of RSS newsreader. If you want to have a go, you can drag the Javascript link from here. Feel free to improve things!

The OS tables are turning…

I recently bought a Hama multi-slot card reader, primarily for reading the Smart Media cards used in our camera. It came with software for Windows. I installed it on our Windows 98 machine, and plugged in the device, following the instructions to the letter. Ka-boom! Blue screen. After about an hour of trying and retrying to make it work (even installing upgraded drivers for the VIA chipset as recommended in the troubleshooting section), I was still no further on. Plugging in the device crashed Windows. Period.

About to package the thing up to take it back, I passed the house server running Linux. What the heck, I thought, and plugged it in the back. “Ooh, hello”, said the kernel. I mounted the emulated SCSI device, and grabbed the pictures of the Smart Media card. Easy as that.

The tables have turned. In times past, it used to be that peripherals Just Worked with Windows (mostly because the vendors targeted the drivers to that platform). Not any more.

I’m a happy Linux user.

Just finished re-reading: The Player Of Games (Iain M Banks)

I read this a few years ago, and don’t think I appreciated some of the finer points (how many books don’t deserve a re-reading?).

You can find out about the book at Amazon so I won’t bother with the plot. It’s a wonderful study in far future tech – the ships, minds, and drones – which the characters, the author, and eventually you, the reader, take for granted (the tech doesn’t obscure the plot or the interplay of characters, but it’s wondrous all the same), interplay between human(oid) and artificial intelligence, and the tangents of differing civilizations.

But what struck me most this time around was the way that I, the reader, naturally associated myself with the Culture (the civilization to which the central characters belong) – mostly, perhaps, because the Culture was the basis from which the plot stems, and regarded the Empire (the civilization that begat the game Azad) as the “aliens”. But the more one progressed through this novel it was clear, almost politically clear, that in fact the unruly, violent, and relatively primitive Empire civilization … was ours.

A great read.

I wonder how I could reuse this blog item as a review item in the book’s review section on Amazon? Hmm, how about an RSS 1.0 module and Amazon binding in support for that?

You know you’re getting old …

…when it takes you over two weeks to recover from OSCON. What with the travel (ok, including a connectionless week in Manchester visiting relatives), the email backlog, and the catch-up at work, not to mention the overwhelming saturation of information, ideas, inspiration, and other things beginning with ‘i’ that came from the great time that was OSCON, I really need a post-conference holiday. I can’t begin to imagine what the organisers feel like.

It was as much the opportunities to meet and chat with other like-minded individuals, exchange thoughts and ideas, and generally make new friends, as it was the talks and tutorials that I (and probably many other attendees) valued there.

Needless to say, I also grabbed the chance to take my annual fill of U.S. food – chilli dogs, cheese fries, burritos, and cinnamon and raisin bagels. Yum.