rss_converter_instagram.com.xsl: improve channel description
authorAntonio Ospite <ao2@ao2.it>
Sun, 13 Sep 2015 16:06:59 +0000 (18:06 +0200)
committerAntonio Ospite <ao2@ao2.it>
Sun, 13 Sep 2015 18:04:21 +0000 (20:04 +0200)
Some users have a biography, some users only have an external URL, some
users have both and some have neither.

Make the channel description a little smarter trying to handle these
case.

rss_converter_instagram.com.xsl

index bf83dde..5ce83dd 100644 (file)
                     <xsl:value-of select="$channel-link"/>
                 </link>
                 <description>
-                    <xsl:value-of select="//user/biography"/>
+                    <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
+                    <xsl:value-of select="normalize-space(concat($screen-name, '. ', //user/biography))"/>
+                    <xsl:variable name="external-url" select="//user/external_url"/>
+                    <xsl:if test="$external-url != ''">
+                        <xsl:text> </xsl:text><a href="{$external-url}"><xsl:value-of select="$external-url"/></a>
+                    </xsl:if>
+                    <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
                 </description>
                 <image>
                     <title>