summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e64422f)
The new Instagram homepage provides json data in a format different than
before, update the xsl to support it.
Unfortunately the data in the new format does not provide the
descriptions of the items, so use some placeholder values (URL, comments
count, likes count) to present at least something.
<xsl:value-of disable-output-escaping="yes" select="php:function('Tweeper::generate_enclosure', string(./standard_resolution/url))"/>
</xsl:template>
<xsl:value-of disable-output-escaping="yes" select="php:function('Tweeper::generate_enclosure', string(./standard_resolution/url))"/>
</xsl:template>
- <xsl:variable name="screen-name" select="//UserProfile/XML_Serializer_Tag/user/full_name"/>
- <xsl:variable name="user-name" select="//UserProfile/XML_Serializer_Tag/user/username"/>
+ <xsl:variable name="screen-name" select="//ProfilePage/XML_Serializer_Tag/user/full_name"/>
+ <xsl:variable name="user-name" select="//ProfilePage/XML_Serializer_Tag/user/username"/>
- <xsl:template match="//userMedia/XML_Serializer_Tag">
- <xsl:variable name="item-content-title" select="./caption/text"/>
- <xsl:variable name="item-content-src" select="./images/standard_resolution/url"/>
- <xsl:variable name="item-permalink" select="./link"/>
+ <xsl:template match="//media/nodes/XML_Serializer_Tag">
+ <xsl:variable name="item-content-src" select="./display_src"/>
+ <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)"/>
- <xsl:value-of select="concat($user-name, ': ', $item-content-title)"/>
+ <xsl:value-of select="$item-content-title"/>
</title>
<link>
<xsl:value-of select="$item-permalink"/>
</title>
<link>
<xsl:value-of select="$item-permalink"/>
<xsl:value-of select="$item-permalink"/>
</guid>
<pubDate>
<xsl:value-of select="$item-permalink"/>
</guid>
<pubDate>
- <xsl:variable name="timestamp" select="./created_time"/>
+ <xsl:variable name="timestamp" select="./date"/>
<xsl:value-of select="php:functionString('Tweeper::epoch_to_gmdate', number($timestamp))"/>
</pubDate>
<description>
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
<p><xsl:value-of select="$item-content-title"/></p><br />
<xsl:value-of select="php:functionString('Tweeper::epoch_to_gmdate', number($timestamp))"/>
</pubDate>
<description>
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
<p><xsl:value-of select="$item-content-title"/></p><br />
- <img src="{$item-content-src}" title="{$item-content-title}" />
+ <a href="{$item-permalink}"><img src="{$item-content-src}" /></a>
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</description>
<xsl:if test="$generateEnclosure = 1">
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</description>
<xsl:if test="$generateEnclosure = 1">
<xsl:template match="/">
<xsl:variable name="channel-title" select="concat('Instagram / ', $screen-name)"/>
<xsl:template match="/">
<xsl:variable name="channel-title" select="concat('Instagram / ', $screen-name)"/>
- <xsl:variable name="channel-link" select="concat($BaseURL, //user/__path)"/>
+ <xsl:variable name="channel-link" select="concat($BaseURL, //__path)"/>
<rss version="2.0">
<xsl:attribute name="xml:base"><xsl:value-of select="$BaseURL" /></xsl:attribute>
<rss version="2.0">
<xsl:attribute name="xml:base"><xsl:value-of select="$BaseURL" /></xsl:attribute>
<xsl:value-of select="$channel-link"/>
</link>
<description>
<xsl:value-of select="$channel-link"/>
</link>
<description>
- <xsl:value-of select="//user/bio"/>
+ <xsl:value-of select="//user/biography"/>
</description>
<image>
<title>
</description>
<image>
<title>
<xsl:value-of select="$channel-link"/>
</link>
<url>
<xsl:value-of select="$channel-link"/>
</link>
<url>
- <xsl:value-of select="//user/profile_picture"/>
+ <xsl:value-of select="//user/profile_pic_url"/>
- <xsl:apply-templates select="//userMedia/XML_Serializer_Tag"/>
+ <xsl:apply-templates select="//media/nodes/XML_Serializer_Tag"/>
</channel>
</rss>
</xsl:template>
</channel>
</rss>
</xsl:template>