Skip to content

Instantly share code, notes, and snippets.

@Answeror
Last active August 29, 2015 14:05
Show Gist options
  • Save Answeror/d76514c59f1059470fd7 to your computer and use it in GitHub Desktop.
Save Answeror/d76514c59f1059470fd7 to your computer and use it in GitHub Desktop.
V2EX user replies Atom feed
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method='xml' encoding='UTF-8'/>
<xsl:template match='/'>
<feed xml:lang='en-US' xmlns='http://www.w3.org/2005/Atom'>
<id>v2ex.com/member/{{ id }}</id>
<link rel='alternate' type='text/html' href='http://v2ex.com/member/{{ id }}'/>
<title>V2EX user replies of {{ id }}</title>
<xsl:for-each select='.//div[@class="dock_area"]'>
<entry>
<id><xsl:value-of select='.//a/@href'/></id>
<link rel='alternate' type='text/html' href='http://v2ex.com{.//a/@href}'/>
<title><xsl:value-of select='.//span[@class="gray"]'/></title>
<summary><xsl:value-of select='.//span[@class="gray"]'/></summary>
<content type='text'><xsl:value-of select='.//span[@class="gray"]'/></content>
</entry>
</xsl:for-each>
</feed>
</xsl:template>
</xsl:stylesheet>
{
"@xslt": {
"html": {
"@base64_decode": {
"[]": [
{"@request": "http://v2ex.com/member/{{ id }}"},
"body"
]
}
},
"xslt": {
"@jinja2": {
"template": {"text<": "atom.xslt"},
"kargs": {
"id": "{{ id }}"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment