X-Git-Url: https://git.ao2.it/tweeper.git/blobdiff_plain/72485ebd9b564be20255a3377d381dc1b94c0359..47350899b24fb9a79bd9f57bcabc7281b9a01e34:/rss_converter_twitter.com.xsl diff --git a/rss_converter_twitter.com.xsl b/rss_converter_twitter.com.xsl index 76937e4..c154141 100644 --- a/rss_converter_twitter.com.xsl +++ b/rss_converter_twitter.com.xsl @@ -24,56 +24,161 @@ xsl:extension-element-prefixes="php" exclude-result-prefixes="php"> - + - + https://twitter.com + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + + + + - <xsl:value-of select="concat($user-name, ': ', $tweet-text)"/> + <xsl:value-of select="concat($user-name, ': ')"/> + <xsl:if test="$item-has-video"> + <xsl:text>(Video) </xsl:text> + </xsl:if> + <!-- + Prepend a space in front of the URLs which are not + preceded by an open parenthesis, for aestethic reasons. + Also, regex, I know: http://xkcd.com/1171/ + --> + <xsl:variable + name="processed-title" + select="php:functionString('preg_replace', '@((?<!\()(?:http[s]?://|pic.twitter.com))@', ' \1', $item-content)"/> + <!-- Also strip   and … --> + <xsl:value-of select="normalize-space(translate($processed-title, ' …', ''))"/> - + - + - + <![CDATA[ - + + (Video) + + + ]]> - - + + + - + + + + + + + + + + - + Tweeper @@ -83,7 +188,7 @@ <xsl:value-of select="$channel-link"/> </link> <description> - <xsl:value-of select="//meta[@name='description']/@content"/> + <xsl:value-of select="normalize-space(//div[@class='ProfileHeaderCard'])"/> </description> <image> <title> @@ -93,10 +198,10 @@ <xsl:value-of select="$channel-link"/> </link> <url> - <xsl:value-of select="//a[contains(@class, 'profile-picture media-thumbnail')]/@href"/> + <xsl:value-of select="//a[contains(@class, 'profile-picture')]/@href"/> </url> </image> - <xsl:apply-templates select="//*[@data-item-type='tweet']"/> + <xsl:apply-templates select="//ol[@id='stream-items-id']/li[@data-item-id and @data-item-type='tweet']"/> </channel> </rss> </xsl:template>