<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:php="http://php.net/xsl"
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:php="http://php.net/xsl"
- <!-- 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:attribute name="href">
<xsl:value-of select="concat(@data-image-url, ':orig')"/>
</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="concat(@data-image-url, ':orig')"/>
</xsl:attribute>
<xsl:variable name="user-name" select=".//div[@data-tweet-id]/@data-screen-name"/>
<xsl:variable name="item-content" select=".//p[contains(@class, 'js-tweet-text')]"/>
<xsl:variable name="item-media" select=".//div[contains(@class, 'AdaptiveMedia-container')]"/>
<xsl:variable name="item-permalink" select="concat($BaseURL, .//div[@data-permalink-path]/@data-permalink-path)"/>
<xsl:variable name="item-has-video" select="$item-media//*[contains(@class, 'PlayableMedia--video')]"/>
<xsl:variable name="user-name" select=".//div[@data-tweet-id]/@data-screen-name"/>
<xsl:variable name="item-content" select=".//p[contains(@class, 'js-tweet-text')]"/>
<xsl:variable name="item-media" select=".//div[contains(@class, 'AdaptiveMedia-container')]"/>
<xsl:variable name="item-permalink" select="concat($BaseURL, .//div[@data-permalink-path]/@data-permalink-path)"/>
<xsl:variable name="item-has-video" select="$item-media//*[contains(@class, 'PlayableMedia--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:apply-templates select="$item-content/node()"/>
- <xsl:apply-templates select="$item-media/node()"/>
+ <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>
- <image>
- <title>
- <xsl:value-of select="$channel-title"/>
- </title>
- <link>
- <xsl:value-of select="$channel-link"/>
- </link>
- <url>
- <xsl:value-of select="//a[contains(@class, 'profile-picture')]/@href"/>
- </url>
- </image>
+ <xsl:if test="$channel-image != ''">
+ <image>
+ <title>
+ <xsl:value-of select="$channel-title"/>
+ </title>
+ <link>
+ <xsl:value-of select="$channel-link"/>
+ </link>
+ <url>
+ <xsl:value-of select="$channel-image"/>
+ </url>
+ </image>
+ </xsl:if>
+
+ <!-- These rules will only match on permalink URLs -->
+ <xsl:apply-templates select="//div[@class='permalink-inner permalink-tweet-container']"/>
+ <xsl:apply-templates select="//div[@data-component-context='replies']//li[@data-item-id and @data-item-type='tweet' and not(contains(@class, 'has-profile-promoted-tweet'))]"/>
+