projects
/
tweeper.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "Add back partial support for twitter.com using the old twitter mobile UI"
[tweeper.git]
/
src
/
rss_converter_twitter.com.xsl
diff --git
a/src/rss_converter_twitter.com.xsl
b/src/rss_converter_twitter.com.xsl
index
1d98fa2
..
e14eaac
100644
(file)
--- a/
src/rss_converter_twitter.com.xsl
+++ b/
src/rss_converter_twitter.com.xsl
@@
-1,7
+1,7
@@
<!--
Stylesheet to convert Twitter user timelines to RSS.
<!--
Stylesheet to convert Twitter user timelines to RSS.
- Copyright (C) 2013-20
18
Antonio Ospite <ao2@ao2.it>
+ Copyright (C) 2013-20
20
Antonio Ospite <ao2@ao2.it>
This file is part of tweeper.
This file is part of tweeper.
@@
-24,6
+24,8
@@
exclude-result-prefixes="php">
<xsl:param name="generate-enclosure"/>
exclude-result-prefixes="php">
<xsl:param name="generate-enclosure"/>
+ <xsl:param name="show-usernames"/>
+ <xsl:param name="show-multimedia"/>
<xsl:output method="xml" indent="yes"/>
<xsl:output method="xml" indent="yes"/>
@@
-71,15
+73,17
@@
too instead of the t.co redirections.
-->
<xsl:template match="a[@data-pre-embedded='true']">
too instead of the t.co redirections.
-->
<xsl:template match="a[@data-pre-embedded='true']">
- <!-- Prepend and append a white space for aestethic reasons -->
- <xsl:text> </xsl:text>
- <a>
- <xsl:attribute name="href">
+ <xsl:if test="$show-multimedia = 1">
+ <!-- Prepend and append a white space for aestethic reasons -->
+ <xsl:text> </xsl:text>
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat('https://', .)"/>
+ </xsl:attribute>
<xsl:value-of select="concat('https://', .)"/>
<xsl:value-of select="concat('https://', .)"/>
- </xsl:attribute>
- <xsl:value-of select="concat('https://', .)"/>
- </a>
- <xsl:text> </xsl:text>
+ </a>
+ <xsl:text> </xsl:text>
+ </xsl:if>
</xsl:template>
<!-- Present images in a more convenient way -->
</xsl:template>
<!-- Present images in a more convenient way -->
@@
-127,7
+131,9
@@
<xsl:variable name="item-has-gif" select="$item-media//*[contains(@class, 'PlayableMedia--gif')]"/>
<item>
<title>
<xsl:variable name="item-has-gif" select="$item-media//*[contains(@class, 'PlayableMedia--gif')]"/>
<item>
<title>
- <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>
<xsl:if test="$item-has-video">
<xsl:text>(Video) </xsl:text>
</xsl:if>
@@
-154,8
+160,10
@@
</pubDate>
<description>
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
</pubDate>
<description>
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
- <xsl:value-of select="concat($user-name, ':')"/>
- <xsl:element name="br"/>
+ <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:element name="br"/>
<xsl:if test="$item-has-video">
<xsl:text> (Video)</xsl:text>
<xsl:element name="br"/>
@@
-168,7
+176,9
@@
<xsl:attribute name="style">white-space: pre-wrap;</xsl:attribute>
<xsl:apply-templates select="$item-content/node()"/>
</xsl:element>
<xsl:attribute name="style">white-space: pre-wrap;</xsl:attribute>
<xsl:apply-templates select="$item-content/node()"/>
</xsl:element>
- <xsl:apply-templates select="$item-media/node()"/>
+ <xsl:if test="$show-multimedia = 1">
+ <xsl:apply-templates select="$item-media/node()"/>
+ </xsl:if>
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</description>
<xsl:if test="$generate-enclosure = 1">
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</description>
<xsl:if test="$generate-enclosure = 1">