rss_converter_instagram.com.xsl: use the image caption as the item content
authorAntonio Ospite <ao2@ao2.it>
Sat, 25 Jul 2015 10:43:49 +0000 (12:43 +0200)
committerAntonio Ospite <ao2@ao2.it>
Sat, 25 Jul 2015 13:48:19 +0000 (15:48 +0200)
Instagram has reintroduced serving the image caption in the json data,
so use it; it is way nicer than the stats tweeper was showing before.

rss_converter_instagram.com.xsl

index 1bb580f..9ef06ef 100644 (file)
 
     <xsl:template match="//media/nodes/XML_Serializer_Tag">
         <xsl:variable name="item-content-image" select="./display_src"/>
 
     <xsl:template match="//media/nodes/XML_Serializer_Tag">
         <xsl:variable name="item-content-image" select="./display_src"/>
+        <xsl:variable name="item-content-caption" select="./caption"/>
         <xsl:variable name="item-permalink" select="concat($BaseURL, '/p/', ./code, '/')"/>
         <xsl:variable name="item-permalink" select="concat($BaseURL, '/p/', ./code, '/')"/>
-        <xsl:variable name="item-content-title" select="concat($user-name, ': ', $item-permalink, ', comments: ', ./comments/count, ', likes: ', ./likes/count)"/>
         <item>
             <title>
         <item>
             <title>
-                <xsl:value-of select="$item-content-title"/>
+                <xsl:value-of select="$item-content-caption"/>
             </title>
             <link>
                 <xsl:value-of select="$item-permalink"/>
             </title>
             <link>
                 <xsl:value-of select="$item-permalink"/>
@@ -59,7 +59,7 @@
             </pubDate>
             <description>
                 <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
             </pubDate>
             <description>
                 <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
-                <p><xsl:value-of select="$item-content-title"/></p><br />
+                <p><xsl:value-of select="$item-content-caption"/></p><br />
                 <a href="{$item-permalink}"><img src="{$item-content-image}" /></a>
                 <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
             </description>
                 <a href="{$item-permalink}"><img src="{$item-content-image}" /></a>
                 <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
             </description>