Skip to content

Commit

Permalink
cont
Browse files Browse the repository at this point in the history
  • Loading branch information
lindenb committed Dec 25, 2020
1 parent 0af214d commit a9ff2df
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions stylesheets/instagram/jsonx2html.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version='1.0' ?>
<xsl:stylesheet
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:x="http://www.ibm.com/xmlns/prod/2009/jsonx"
version='1.0'
>
<!--
-->
<xsl:output method="html" />


<xsl:template match="/">
<html>
<head>
<style>
</style>
</head>
<body>
<xsl:apply-templates select="//x:object[x:array[@name='thumbnail_resources']]"/>
</body></html>
</xsl:template>

<xsl:template match="x:object[x:array[@name='thumbnail_resources']]">
<xsl:variable name="F1" select="x:array[@name='thumbnail_resources']/x:object[1]"/>
<span>
<a>
<xsl:attribute name="href">https://www.instagram.com/p/<xsl:value-of select="x:string[@name='shortcode']"/></xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="normalize-space(x:object[@name='edge_media_to_caption']//x:string[@name='text']/text())"/>
</xsl:attribute>
<img>
<xsl:attribute name="src">
<xsl:value-of select="$F1/x:string[@name='src']/text()"/>
</xsl:attribute>
<xsl:attribute name="width">
<xsl:value-of select="$F1/x:number[@name='config_width']/text()"/>
</xsl:attribute>
<xsl:attribute name="height">
<xsl:value-of select="$F1/x:number[@name='config_height']/text()"/>
</xsl:attribute>
</img>
</a>
</span>
</xsl:template>
</xsl:stylesheet>

0 comments on commit a9ff2df

Please sign in to comment.