Skip to content

Instantly share code, notes, and snippets.

View Answeror's full-sized avatar

Cosmo Du Answeror

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Answeror
Answeror / dumpkanji.py
Created December 30, 2013 16:02
hanzi(chinese) to kanji(japanese) character conversion
import requests
from bs4 import BeautifulSoup as BS
import json
def gen(soup):
for tr in soup.select('tr'):
tds = tr.select('td.tdR4')
if len(tds) == 6:
yield tds[2].string, tds[3].string
@Answeror
Answeror / README.md
Last active July 14, 2017 11:51
Bangumi私信订阅

Bangumi私信订阅

这个gist由torabot自动抓取并生成Atom feed.

使用方法

注意: 公开你的cookie是一件危险的事情. 别人可能利用它来滥用你的Bangumi账户! Torabot的作者保证不会使用你的cookie做这个gist功能以外的事情. 如果你不信任torabot, 请忽略这个gist.

例子: http://torabot.com/api/source/34fd6a535090ca85a2fc.atom?chii_auth=<chii_auth_in_your_cookie>

@Answeror
Answeror / README.md
Last active August 29, 2015 14:03
Bangumi评论订阅
@Answeror
Answeror / main.json
Last active August 29, 2015 14:03
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 }}"}
}]
@Answeror
Answeror / replies.xml
Created July 6, 2014 13:34
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>
@Answeror
Answeror / README.md
Last active February 19, 2020 09:59
page update notice based on md5
@Answeror
Answeror / atom.xslt
Last active August 29, 2015 14:05
New York City Department of Transportation 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>nyc</id>
<link rel='alternate' type='text/html' href='http://www.nyc.gov/html/dot/html/home/home.shtml'/>
@Answeror
Answeror / atom.xslt
Last active August 29, 2015 14:05
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>