X-Git-Url: https://git.ao2.it/tweeper.git/blobdiff_plain/b187bb677361d17a468abf749332d081a194b4bd..refs/heads/master:/src/rss_converter_twitter.com.xsl?ds=sidebyside diff --git a/src/rss_converter_twitter.com.xsl b/src/rss_converter_twitter.com.xsl index c154141..e14eaac 100644 --- a/src/rss_converter_twitter.com.xsl +++ b/src/rss_converter_twitter.com.xsl @@ -1,7 +1,7 @@ - + + @@ -67,15 +73,17 @@ too instead of the t.co redirections. --> - - - - + + + + + + + - - - - + + + @@ -84,7 +92,7 @@ - + @@ -97,32 +105,35 @@ - + - + - + - - + + + - <xsl:value-of select="concat($user-name, ': ')"/> + <xsl:if test="($show-usernames = 1) or ($screen-name != $user-name)"> + <xsl:value-of select="concat($user-name, ': ')"/> + </xsl:if> <xsl:if test="$item-has-video"> <xsl:text>(Video) </xsl:text> </xsl:if> @@ -145,16 +156,29 @@ </guid> <pubDate> <xsl:variable name="timestamp" select=".//span[contains(@class, 'js-short-timestamp')]/@data-time"/> - <xsl:value-of select="php:functionString('Tweeper::epochToRssDate', number($timestamp))"/> + <xsl:value-of select="php:functionString('Tweeper\Tweeper::epochToRssDate', number($timestamp))"/> </pubDate> <description> - <xsl:value-of select="concat($user-name, ': ')"/> <xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text> + <xsl:if test="($show-usernames = 1) or ($screen-name != $user-name)"> + <xsl:value-of select="concat($user-name, ':')"/> + <xsl:element name="br"/> + </xsl:if> <xsl:if test="$item-has-video"> - <xsl:text>(Video) </xsl:text> + <xsl:text> (Video)</xsl:text> + <xsl:element name="br"/> + </xsl:if> + <xsl:if test="$item-has-gif"> + <xsl:text> (GIF)</xsl:text> + <xsl:element name="br"/> + </xsl:if> + <xsl:element name="span"> + <xsl:attribute name="style">white-space: pre-wrap;</xsl:attribute> + <xsl:apply-templates select="$item-content/node()"/> + </xsl:element> + <xsl:if test="$show-multimedia = 1"> + <xsl:apply-templates select="$item-media/node()"/> </xsl:if> - <xsl:apply-templates select="$item-content/node()"/> - <xsl:apply-templates select="$item-media/node()"/> <xsl:text disable-output-escaping="yes">]]></xsl:text> </description> <xsl:if test="$generate-enclosure = 1"> @@ -176,6 +200,7 @@ </xsl:choose> </xsl:variable> <xsl:variable name="channel-link" select="//link[@rel='canonical']/@href"/> + <xsl:variable name="channel-image" select="//a[contains(@class, 'profile-picture')]/@href"/> <rss version="2.0"> <xsl:attribute name="xml:base"><xsl:value-of select="$BaseURL" /></xsl:attribute> @@ -189,19 +214,28 @@ </link> <description> <xsl:value-of select="normalize-space(//div[@class='ProfileHeaderCard'])"/> + <!-- The following rule should only match on hashtag URLs --> + <xsl:value-of select="normalize-space(//div[@class='SearchNavigation-textContainer'])"/> </description> - <image> - <title> - <xsl:value-of select="$channel-title"/> - - - - - - - - - + + + + <xsl:value-of select="$channel-title"/> + + + + + + + + + + + + + + +