I was fiddling with Ijirait again, my Gemini-based MUSH. When you connect, it requests a client certificate to log you in, and that’s how it should be. But I also wanted to offer some form of “activity” signal to the outside world without forcing a visitor to generate a new identity (generating a client certificate also means creating a character in the game, which sounds a bit like a waste).
And here’s where I got a brain fart. Instead of simply generating a gemtext document, I generated some RSS, which I then couldn’t read using a feed reader. D’oh! And the double brain fart happened when I decided to improvise an XSLT document to transform the RSS into gemtext. How bad can it be?
Here’s the XSLT:
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" /> <xsl:template match="channel/title"> # <xsl:value-of select="." /> </xsl:template> <xsl:template match="item/title"> ## <xsl:value-of select="." /> </xsl:template> <xsl:template match="description"><xsl:value-of select="." /></xsl:template> <xsl:template match="pubDate|generator|docs|link"></xsl:template> </xsl:stylesheet>
And here’s how to call it (with ‘gemini’ being my command line tool), stripping the Gemini header using ‘tail’, processing the file using ‘xsltproc’, and stripping the empty lines using ‘grep’.
$ gemini gemini://campaignwiki.org/play/ijirait/rss | tail -n +2 | xsltproc ~/src/gemini-xslt/gemini.xslt - | grep -v '^