X-Git-Url: https://git.ao2.it/tweeper.git/blobdiff_plain/b187bb677361d17a468abf749332d081a194b4bd..ba0b9d840dfa0febecba2e7d784d0be29ff1ee0f:/src/rss_converter_pump.io.xsl?ds=inline diff --git a/src/rss_converter_pump.io.xsl b/src/rss_converter_pump.io.xsl index 1577dcf..42f8ac0 100644 --- a/src/rss_converter_pump.io.xsl +++ b/src/rss_converter_pump.io.xsl @@ -1,7 +1,7 @@ <!-- Stylesheet to convert Pump.io activity streams to RSS. - Copyright (C) 2013-2014 Antonio Ospite <ao2@ao2.it> + Copyright (C) 2013-2018 Antonio Ospite <ao2@ao2.it> This file is part of tweeper. @@ -22,9 +22,11 @@ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl" - xsl:extension-element-prefixes="php" exclude-result-prefixes="php"> + <xsl:param name="generate-enclosure"/> + <xsl:param name="show-usernames"/> + <xsl:output method="xml" indent="yes"/> <xsl:variable name="domain-name" select="substring-after(//div[@id='profile-block']/@data-profile-id, '@')"/> @@ -37,7 +39,10 @@ <xsl:variable name="item-permalink" select=".//p[@class='muted']/small/a/@href"/> <item> <title> - <xsl:value-of select="concat($user-name, ': ', normalize-space($item-content))"/> + <xsl:if test="$show-usernames = 1"> + <xsl:value-of select="concat($user-name, ': ')"/> + </xsl:if> + <xsl:value-of select="normalize-space($item-content)"/> </title> <link> <xsl:value-of select="$item-permalink"/> @@ -46,11 +51,13 @@ <xsl:value-of select="$item-permalink"/> </guid> <pubDate> - <xsl:value-of select="php:functionString('Tweeper::strToRssDate', .//abbr[@class='easydate']/@title)"/> + <xsl:value-of select="php:functionString('Tweeper\Tweeper::strToRssDate', .//abbr[@class='easydate']/@title)"/> </pubDate> <description> - <xsl:value-of select="concat($user-name, ': ')"/> <xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text> + <xsl:if test="$show-usernames = 1"> + <xsl:value-of select="concat($user-name, ': ')"/> + </xsl:if> <xsl:copy-of select="$item-content/node()"/> <xsl:text disable-output-escaping="yes">]]></xsl:text> </description> @@ -58,7 +65,7 @@ <xsl:variable name="image-thumb-link" select=".//img[contains(@class, 'object-image')]/@src"/> <xsl:if test="$image-thumb-link"> <xsl:variable name="image-link" select="php:functionString('str_replace', '_thumb', '', $image-thumb-link)"/> - <xsl:copy-of select="php:functionString('Tweeper::generateEnclosure', $image-link)"/> + <xsl:copy-of select="php:functionString('Tweeper\Tweeper::generateEnclosure', $image-link)"/> </xsl:if> </xsl:if> </item> @@ -89,7 +96,7 @@ <xsl:value-of select="$channel-link"/> </link> <url> - <xsl:value-of select="//div[@id='profile-block']/span/img[@class='img-rounded media-object']/@src"/> + <xsl:value-of select="//div[@id='profile-block']/span/img[contains(@class, 'img-rounded media-object')]/@src"/> </url> </image> <xsl:apply-templates select="//div[@id='user-content-activities']//ul[@id='major-stream']/li"/>