This has two benefits:
- make it possible to handle multiple enclosures;
- handle _only_ the anchors with the 'data-expanded-url' attribute,
before the change every anchor with the 'twitter-timeline-link'
attribute was handled.
The change also makes the DOM navigation a little lighter because now
only $tweet-text is searched for the 'data-expanded-url' attribute.
<xsl:text>https://twitter.com</xsl:text>
</xsl:variable>
<xsl:text>https://twitter.com</xsl:text>
</xsl:variable>
+ <xsl:template match="a[@data-expanded-url]">
+ <xsl:value-of disable-output-escaping="yes" select="php:function('generate_enclosure', string(./@data-expanded-url))"/>
+ </xsl:template>
+
<xsl:variable name="screen-name" select="//div[@class='profile-card-inner']/@data-screen-name"/>
<xsl:template match="//div[@id='timeline']//ol[@id='stream-items-id']//li[@data-item-type='tweet']">
<xsl:variable name="screen-name" select="//div[@class='profile-card-inner']/@data-screen-name"/>
<xsl:template match="//div[@id='timeline']//ol[@id='stream-items-id']//li[@data-item-type='tweet']">
<xsl:copy-of select="$tweet-text/node()"/>
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</description>
<xsl:copy-of select="$tweet-text/node()"/>
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</description>
- <xsl:value-of disable-output-escaping="yes" select="php:function('generate_enclosure', string(.//a[@class='twitter-timeline-link']/@data-expanded-url))"/>
+ <xsl:apply-templates select="$tweet-text//a[@data-expanded-url]"/>