X-Git-Url: https://git.ao2.it/tweeper.git/blobdiff_plain/57535fd5825c6c112b6489c27e469bc4143c1a2e..6e2aff201c8017b2076020cd12ec723cbdba6aae:/src/rss_converter_instagram.com.xsl diff --git a/src/rss_converter_instagram.com.xsl b/src/rss_converter_instagram.com.xsl index 609be66..bd67951 100644 --- a/src/rss_converter_instagram.com.xsl +++ b/src/rss_converter_instagram.com.xsl @@ -1,7 +1,7 @@ + + + - - + + + + + @@ -47,14 +60,14 @@ - - - - + + + + <xsl:variable name="title-length" select="140"/> - <xsl:variable name="item-content-title" select="normalize-space(concat($user-name, ': ', $item-content-caption))"/> + <xsl:variable name="item-content-title" select="normalize-space(concat($screen-name, ': ', $item-content-caption))"/> <!-- ellipsize, inspired from http://stackoverflow.com/questions/13622338 --> <xsl:choose> <xsl:when test="string-length($item-content-title) > $title-length"> @@ -74,7 +87,7 @@ <xsl:value-of select="$item-permalink"/> </guid> <pubDate> - <xsl:variable name="timestamp" select="./date"/> + <xsl:variable name="timestamp" select="./taken_at_timestamp"/> <xsl:value-of select="php:functionString('Tweeper\Tweeper::epochToRssDate', $timestamp)"/> </pubDate> <description> @@ -95,8 +108,20 @@ </xsl:template> <xsl:template match="/"> + <xsl:variable name="channel-title" select="concat('Instagram / ', $screen-name)"/> - <xsl:variable name="channel-link" select="concat($BaseURL, '/', $user-name)"/> + <xsl:variable name="channel-link"> + <xsl:choose> + <xsl:when test="$location-name != ''"> + <xsl:variable name="location-id" select="//LocationsPage/graphql/location/id"/> + <xsl:value-of select="concat($BaseURL, '/explore/locations/', $location-id)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="concat($BaseURL, '/', $user-name)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="channel-image" select="//ProfilePage/graphql/user/profile_pic_url"/> <rss version="2.0"> <xsl:attribute name="xml:base"><xsl:value-of select="$BaseURL" /></xsl:attribute> @@ -117,18 +142,20 @@ </xsl:if> <xsl:text disable-output-escaping="yes">]]></xsl:text> </description> - <image> - <title> - <xsl:value-of select="$channel-title"/> - - - - - - - - - + + + + <xsl:value-of select="$channel-title"/> + + + + + + + + + +