src/Tweeper.php: allow overriding the User-Agent in cURL requests
[tweeper.git] / src / rss_converter_instagram.com.xsl
index c714b1b..855ce0b 100644 (file)
 <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:php="http://php.net/xsl"
-    xsl:extension-element-prefixes="php"
     exclude-result-prefixes="php">
 
     <xsl:param name="generate-enclosure"/>
+    <xsl:param name="show-usernames"/>
+    <xsl:param name="show-multimedia"/>
 
     <xsl:output method="xml" indent="yes"/>
 
         <item>
             <title>
                 <xsl:variable name="title-length" select="140"/>
-                <xsl:variable name="item-content-title" select="normalize-space(concat($screen-name, ': ', $item-content-caption))"/>
+                <xsl:variable name="item-content-title">
+                    <xsl:if test="$show-usernames = 1">
+                        <xsl:value-of select="concat($screen-name, ': ')"/>
+                    </xsl:if>
+                    <xsl:value-of select="normalize-space($item-content-caption)"/>
+                </xsl:variable>
                 <!-- ellipsize, inspired from http://stackoverflow.com/questions/13622338 -->
                 <xsl:choose>
                     <xsl:when test="string-length($item-content-title) > $title-length">
                     </xsl:if>
                     <xsl:value-of select="$item-content-caption"/>
                 </p><br />
-                <a href="{$item-permalink}"><img src="{$item-content-image}" style="max-width: 100%"/></a>
+                <xsl:if test="$show-multimedia = 1">
+                    <a href="{$item-permalink}"><img src="{$item-content-image}" style="max-width: 100%"/></a>
+                </xsl:if>
                 <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
             </description>
             <xsl:if test="$generate-enclosure = 1">