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 '^ # Ijirait Recent activity. Didia was active 28 minutes ago Arinte was active 14 hours ago Lerionlaer was active 41 hours ago Belamageon was active 42 hours ago Uscediti was active 44 hours ago Gezaardienbi was active 46 hours ago Atmaxeed was active 2 days ago Arrionorce was active 2 days ago Tilaor was active 2 days ago Anbeinis was active 2 days ago Orcetiar was active 3 days ago Anxediat was active 3 days ago Onatmage was active 3 days ago Xeatesaso was active 4 days ago Orremarile was active 4 days ago Atebi was active 5 days ago Sozare was active 5 days ago Iserle was active 5 days ago Sorele was active 6 days ago Sogequri was active 6 days ago Atqule was active 6 days ago Ononinle was active 6 days ago Orongexe was active 8 days ago Avexeer was active 9 days ago Ijiraq was active 9 days ago
And now I’m probably going to write the same thing, except it’ll be simply gemtext output. 😆
#Ijirait #Gemini #XSLT #RSS