Skip to content

Instantly share code, notes, and snippets.

@Answeror
Last active August 29, 2015 14:03
Show Gist options
  • Save Answeror/e098eb518b3a58c81f3f to your computer and use it in GitHub Desktop.
Save Answeror/e098eb518b3a58c81f3f to your computer and use it in GitHub Desktop.
v2ex评论订阅
{
"@jinja2": {
"template": {"text<": "replies.xml"},
"kargs": {
"id": "{{ id }}",
"replies": {
"@json_decode": {
"@base64_decode": [{
"[body]": {"@request": "http://www.v2ex.com/api/replies/show.json?topic_id={{ id }}"}
}]
}
}
}
}
}
<feed xml:lang='zh-CN' xmlns='http://www.w3.org/2005/Atom'>
<id>v2ex.com/t/{{ id }}</id>
<link rel='alternate' type='text/html' href='http://v2ex.com/t/{{ id }}'/>
<title>{{ id }}</title>
{% for r in replies %}
<entry>
<id>{{ r.id }}</id>
<published>{{ datetime.fromtimestamp(r.created).strftime('%Y-%m-%dT%H:%M:%SZ') }}</published>
<updated>{{ datetime.fromtimestamp(r.last_modified).strftime('%Y-%m-%dT%H:%M:%SZ') }}</updated>
<link rel='alternate' type='text/html' href='http://v2ex.com/t/{{ id }}#r_{{ r.id }}'/>
<title>#{{ loop.index }} {{ r.member.username|e }}</title>
<summary>{{ r.content|e }}</summary>
<content type='html'>
<![CDATA[{{ r.content_rendered }}]]>
</content>
<author>
<name>{{ r.member.username|e }}</name>
<url>http://v2ex.com/member/{{ r.member.username|e }}</url>
</author>
</entry>
{% endfor %}
</feed>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment