rss_converter_twitter.com.xsl: generate enclosure for images
authorAntonio Ospite <ao2@ao2.it>
Fri, 20 May 2016 12:04:03 +0000 (14:04 +0200)
committerAntonio Ospite <ao2@ao2.it>
Fri, 20 May 2016 13:03:41 +0000 (15:03 +0200)
rss_converter_twitter.com.xsl

index dbbc537..857cf31 100644 (file)
         <xsl:copy-of select="php:function('Tweeper::generateEnclosure', string(./@data-expanded-url))"/>
     </xsl:template>
 
+    <xsl:template match="div[@data-image-url]" mode="enclosure">
+        <xsl:copy-of select="php:function('Tweeper::generateEnclosure', string(concat(./@data-image-url, ':orig')))"/>
+    </xsl:template>
+
     <xsl:variable name="screen-name" select="//div[@class='user-actions btn-group not-following ']/@data-screen-name"/>
 
     <xsl:template match="//li[@data-item-id and @data-item-type='tweet']">
             </description>
             <xsl:if test="$generate-enclosure = 1">
                 <xsl:apply-templates select="$item-content//a[@data-expanded-url]" mode="enclosure"/>
+                <xsl:apply-templates select="$item-media//div[@data-image-url]" mode="enclosure"/>
             </xsl:if>
         </item>
     </xsl:template>