xsl: rm broken flattr links

This commit is contained in:
Astro 2018-03-01 17:39:55 +01:00
parent fa852c23af
commit 2b7f6d1ec7
4 changed files with 9 additions and 57 deletions

View File

@ -125,15 +125,6 @@
xmlns:sc="http://podlove.de/simple-chapters"/>
</xsl:for-each>
<xsl:variable name="flattr_link">
<xsl:call-template name="make-flattr-link">
<xsl:with-param name="newsfile" select="$newsfile"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="string-length($flattr_link) &gt; 0">
<link rel="payment" href="{$flattr_link}" type="text/html"/>
</xsl:if>
</entry>
</xsl:template>

View File

@ -974,32 +974,16 @@
</xsl:choose>
</xsl:template>
<xsl:template name="make-flattr-link">
<xsl:param name="newsfile"/>
<xsl:if test="starts-with($newsfile, 'content/news/pentaradio24-') or
starts-with($newsfile, 'content/news/pentacast-') or
starts-with($newsfile, 'content/news/pentamusic-')">
<xsl:text>https://flattr.com/submit/auto?user_id=coloradio&amp;url=</xsl:text>
<xsl:value-of select="str:encode-uri(concat($baseurl, substring-before(substring-after($newsfile, 'content/'), '.xml'), '.html'), true())"/>
<xsl:text>&amp;title=</xsl:text>
<xsl:value-of select="str:encode-uri(document($newsfile)/item/@title, true())"/>
<xsl:text>&amp;description=</xsl:text>
<xsl:value-of select="str:encode-uri(document($newsfile)//p[1], true())"/>
<xsl:text>&amp;language=de&amp;tags=audio,c3d2,podcast&amp;category=audio</xsl:text>
</xsl:if>
<xsl:template name="string-to-lower">
<xsl:param name="string"/>
<xsl:param name="forspace"> </xsl:param>
<xsl:value-of select="translate($string, ' ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞŸŽŠŒ', concat($forspace,'abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ'))"/>
</xsl:template>
<xsl:template name="string-to-lower">
<xsl:param name="string"/>
<xsl:param name="forspace"> </xsl:param>
<xsl:value-of select="translate($string, ' ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞŸŽŠŒ', concat($forspace,'abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ'))"/>
</xsl:template>
<xsl:template name="string-to-upper">
<xsl:param name="string"/>
<xsl:param name="forspace"> </xsl:param>
<xsl:value-of select="translate($string,' abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ',concat($forspace, 'ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞŸŽŠŒ'))"/>
</xsl:template>
<xsl:template name="string-to-upper">
<xsl:param name="string"/>
<xsl:param name="forspace"> </xsl:param>
<xsl:value-of select="translate($string,' abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ',concat($forspace, 'ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞŸŽŠŒ'))"/>
</xsl:template>
</xsl:stylesheet>

View File

@ -49,7 +49,6 @@
<itunes:category text="Technology">
<itunes:category text="Tech News"/>
</itunes:category>
<!-- <atom:link rel="payment" href="https://flattr.com/thing/51034/Pentaradio-24" type="text/html"/> -->
</xsl:when>
<xsl:when test="$selection = 'pentaradio'">
<title>Pentaradio</title>
@ -71,7 +70,6 @@
<itunes:category text="Technology">
<itunes:category text="Tech News"/>
</itunes:category>
<!-- <atom:link rel="payment" href="https://flattr.com/thing/51034/Pentaradio-24" type="text/html"/> -->
</xsl:when>
<xsl:when test="$selection = 'pentacast'">
<title>Pentacast</title>
@ -92,7 +90,6 @@
<itunes:image href="{$baseurl}images/pentacast-artwork.png" />
<itunes:category text="Society &amp; Culture"/>
<itunes:category text="Technology"/>
<!-- <atom:link rel="payment" href="https://flattr.com/thing/51037/Pentacast" type="text/html"/> -->
</xsl:when>
<xsl:when test="$selection = 'pentamusic'">
<title>Pentamusic</title>
@ -114,7 +111,6 @@
<itunes:image href="{$baseurl}images/pentamusic-quadratic.png" />
<itunes:category text="Society &amp; Culture"/>
<itunes:category text="Music"/>
<!-- <atom:link rel="payment" href="https://flattr.com/thing/51039/Pentamusic" type="text/html"/> -->
</xsl:when>
<xsl:otherwise>
<title>C3D2 Podcast</title>
@ -134,7 +130,6 @@
<itunes:image href="{$baseurl}images/ck.png" />
<itunes:category text="Society &amp; Culture"/>
<itunes:category text="Technology"/>
<!-- <atom:link rel="payment" href="https://flattr.com/thing/51034/Pentaradio-24" type="text/html"/> -->
</xsl:otherwise>
</xsl:choose>
<itunes:author>Chaos Computer Club Dresden</itunes:author>
@ -299,15 +294,6 @@
<itunes:subtitle><xsl:value-of select="$resource_title"/></itunes:subtitle>
<itunes:author>CCC Dresden</itunes:author>
<!-- <xsl:variable name="flattr_link">
<xsl:call-template name="make-flattr-link">
<xsl:with-param name="newsfile" select="$newsfile"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="string-length($flattr_link) &gt; 0">
<atom:link rel="payment" href="{$flattr_link}" type="text/html"/>
</xsl:if> -->
<xsl:copy-of select="$chapters"/>
</item>
</xsl:template>

View File

@ -118,15 +118,6 @@
<xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
</content:encoded>
<xsl:variable name="flattr_link">
<xsl:call-template name="make-flattr-link">
<xsl:with-param name="newsfile" select="$newsfile"/>
</xsl:call-template>
</xsl:variable>
<xsl:if test="string-length($flattr_link) &gt; 0">
<atom:link rel="payment" href="{$flattr_link}" type="text/html"/>
</xsl:if>
<xsl:copy-of select="resource/sc:chapters"
xmlns:sc="http://podlove.de/simple-chapters"/>