projects
/
tweeper.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Embed the full HTML content of the tweet in the description field
[tweeper.git]
/
twitter_user_timeline2rss.xsl
diff --git
a/twitter_user_timeline2rss.xsl
b/twitter_user_timeline2rss.xsl
index
79d1662
..
6d72ceb
100644
(file)
--- a/
twitter_user_timeline2rss.xsl
+++ b/
twitter_user_timeline2rss.xsl
@@
-19,7
+19,9
@@
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<xsl:stylesheet version="1.0"
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:php="http://php.net/xsl"
+ xsl:extension-element-prefixes="php">
<xsl:output method="xml" indent="yes"/>
<xsl:output method="xml" indent="yes"/>
@@
-29,24
+31,24
@@
<xsl:variable name="screen-name" select="//div[@class='profile-card-inner']/@data-screen-name"/>
<xsl:variable name="screen-name" select="//div[@class='profile-card-inner']/@data-screen-name"/>
- <!-- TODO: make URLs hyperlinked (http://www.dpawson.co.uk/xsl/rev2/regex2.html) -->
- <xsl:template name="tweet" match="//p[@class='js-tweet-text tweet-text']">
- <xsl:value-of select="$screen-name"/>: <xsl:value-of select=".//p[@class='js-tweet-text tweet-text']"/>
- </xsl:template>
-
<xsl:template match="//div[@id='timeline']//ol[@id='stream-items-id']//li[@data-item-type='tweet']">
<xsl:template match="//div[@id='timeline']//ol[@id='stream-items-id']//li[@data-item-type='tweet']">
+ <xsl:variable name="tweet-text" select=".//p[@class='js-tweet-text tweet-text']"/>
<item>
<title>
<item>
<title>
- <xsl:call-template name="tweet"/>
+ <xsl:value-of select="concat($screen-name, ': ')"/>
+ <xsl:value-of select="$tweet-text"/>
</title>
<link>
<xsl:value-of select="$twitterBaseURL"/><xsl:value-of select=".//a[@class='details with-icn js-details']/@href"/>
</link>
<pubDate>
</title>
<link>
<xsl:value-of select="$twitterBaseURL"/><xsl:value-of select=".//a[@class='details with-icn js-details']/@href"/>
</link>
<pubDate>
- <xsl:value-of select="
.//small[@class='time']//span/@data-time
"/>
+ <xsl:value-of select="
php:functionString('formatDate', .//small[@class='time']//span/@data-time)
"/>
</pubDate>
<description>
</pubDate>
<description>
- <xsl:call-template name="tweet"/>
+ <xsl:value-of select="concat($screen-name, ': ')"/>
+ <xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
+ <xsl:copy-of select="$tweet-text/node()"/>
+ <xsl:text disable-output-escaping="yes">]]></xsl:text>
</description>
</item>
</xsl:template>
</description>
</item>
</xsl:template>