Skip to content

Instantly share code, notes, and snippets.

@Answeror
Created July 6, 2014 13:34
Show Gist options
  • Save Answeror/4943a4093067fe4dea5e to your computer and use it in GitHub Desktop.
Save Answeror/4943a4093067fe4dea5e to your computer and use it in GitHub Desktop.
v2ex评论订阅(屏蔽了answeror的发言)
<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 %}
{% if r.member.username != 'answeror' %}
<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>
{% endif %}
{% endfor %}
</feed>
{
"@jinja2": {
"template": {"text<": "replies.xml"},
"kargs": {
"id": "{{ id }}",
"replies": {
"@json_decode": {
"@base64_decode": {
"[]": [
{"@request": "http://www.v2ex.com/api/replies/show.json?topic_id={{ id }}"},
"body"
]
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment