Add OPML feed

This commit is contained in:
~lucidiot 2021-02-04 22:02:15 +00:00
parent 7dcb970df5
commit 319b654dfc
4 changed files with 81 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
feeds.opml

2
Makefile Normal file
View File

@ -0,0 +1,2 @@
feeds.opml: feed.xml opml.xsl
xsltproc --stringparam current-date "$(shell date -R)" -o feeds.opml opml.xsl feed.xml

View File

@ -133,6 +133,7 @@
<p><code>disable-output-escaping</code> <a href="https://www.w3.org/TR/1999/REC-xslt-19991116#disable-output-escaping">is optional</a> according to the W3C specification since version 1. libxslt, Chromium and Internet Explorer do support it, but Firefox <a href="https://developer.mozilla.org/en-US/docs/Web/API/XSLTProcessor/XSL_Transformations_in_Mozilla_FAQ#can_i_do_disable-output-escaping.3f">chose not to</a>, and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=98168" target="_blank">a Bugzilla ticket</a> for it will celebrate its 20th birthday this year. They do say themselves that this causes issues for RSS support, so I chose to just not care about it. If you are a Firefox user and are seeing raw, unparsed HTML tags in there, I can only suggest using another browser, or just subscribing to this feed and reading this in its home, a RSS aggregator.</p>
]]></description>
</item>
<item>
<title>Shameless Self Promotion</title>
<pubDate>Thu, 4 Feb 2021 19:57:11 +0000</pubDate>
@ -143,5 +144,17 @@
A blog from a kind friend of mine that has been running for nearly 18 years, mostly covering electronics and software along with books and personal things. I don't know much about electronics but it is fascinating for me to see things being done with that anyway.
</description>
</item>
<item>
<title>OPML now available</title>
<pubDate>Thu, 4 Feb 2021 22:00:11 +0000</pubDate>
<guid isPermaLink="false">rsrsss-opml</guid>
<category domain="https://envs.net/~lucidiot/rsrsss/">Meta</category>
<category domain="https://envs.net/~lucidiot/rsrsss/">OPML</category>
<link>https://envs.net/~lucidiot/rsrsss/feeds.opml</link>
<description><![CDATA[
<p>I added <a href="https://envs.net/~lucidiot/rsrsss/opml.xsl">yet another XSLT stylesheet</a> and there is now an OPML subscriptions file available if you are feeling lazy and want to add all the feeds I talk about here. It is built by hand using a Makefile—I need to remember to run it on every new feed…</p>
]]></description>
</item>
</channel>
</rss>

65
opml.xsl Normal file
View File

@ -0,0 +1,65 @@
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" />
<xsl:param name="current-date" />
<xsl:template match="channel">
<opml version="2.0">
<head>
<title>RSRSSS curated feeds</title>
<xsl:if test="$current-date">
<dateModified>
<xsl:value-of select="$current-date" />
</dateModified>
</xsl:if>
<ownerName>lucidiot</ownerName>
<ownerEmail>lucidiot@envs.net</ownerEmail>
<ownerId>https://tilde.town/~lucidiot/contact.html</ownerId>
<docs>http://dev.opml.org/spec2.html</docs>
</head>
<body>
<xsl:apply-templates select="item[category[@domain='https://envs.net/~lucidiot/rsrsss/' and text()='Feed'] and link]" />
</body>
</opml>
</xsl:template>
<xsl:template match="item[category[@domain='https://envs.net/~lucidiot/rsrsss/' and text()='Feed'] and link]">
<xsl:element name="outline">
<xsl:attribute name="type">rss</xsl:attribute>
<xsl:attribute name="text">
<xsl:value-of select="title" />
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="title" />
</xsl:attribute>
<xsl:attribute name="xmlUrl">
<xsl:value-of select="link" />
</xsl:attribute>
<xsl:if test="description">
<xsl:attribute name="description">
<xsl:value-of select="normalize-space(description)" />
</xsl:attribute>
</xsl:if>
<xsl:if test="pubDate">
<xsl:attribute name="created">
<xsl:value-of select="pubDate" />
</xsl:attribute>
</xsl:if>
<xsl:if test="category[@domain='https://envs.net/~lucidiot/rsrsss/' and text()!='Feed']">
<xsl:attribute name="category">
<xsl:for-each select="category[@domain='https://envs.net/~lucidiot/rsrsss/' and text()!='Feed']">
<xsl:text>/</xsl:text>
<xsl:value-of select="." />
<xsl:if test="position() != last()">,</xsl:if>
</xsl:for-each>
</xsl:attribute>
</xsl:if>
</xsl:element>
</xsl:template>
</xsl:stylesheet>