예제 #1
0
def out_rss(req, tid):
    response.set_header('content-type', 'application/rss+xml; charset=utf-8')
    if req == 'topic':
        return rss.gen_topic(tid)
    elif req == 'msgs':
        return rss.gen_blog(tid)
    else:
        return rss.gen_all(tid)
예제 #2
0
파일: run.py 프로젝트: gk11-ru/ii-elp
def list_txt():
    response.set_header('content-type', 'text/plain; charset=utf-8')
    lst = api.load_echo(False)[1:]
    if request.query.el:
        el = request.query.el.split('/')
        descs = dict([(a, c.decode('utf-8')) for a, b, c in lst])
        lst = [(x, api.echoarea_count(x), descs[x] if x in descs else '')
               for x in el]
    if request.query.n:
        return '\n'.join([t[0] for t in lst])
    elif request.query.h:
        return '\n'.join([
            '%s:%s:hsh/%s' % (t[0], t[1], sx.hsh(api.get_echoarea(t[0], True)))
            for t in lst
        ])
    else:
        return '\n'.join(['%s:%s:%s' % t for t in lst])
예제 #3
0
파일: run.py 프로젝트: gk11-ru/ii-elp
def index_list(names):
    response.set_header('content-type', 'text/plain; charset=utf-8')
    return api.echoareas(names.split('/'), request.query.sf)
예제 #4
0
파일: run.py 프로젝트: gk11-ru/ii-elp
def jt_outmsg(h):
    response.set_header('content-type', 'text/plain; charset=iso-8859-1')
    lst = [x for x in h.split('/') if len(x) == 20 or len(x) == 8]
    return '\n'.join([api.mk_jt(x, api.raw_msg(x)) for x in lst])
예제 #5
0
파일: run.py 프로젝트: gk11-ru/ii-elp
def blacklist_txt():
    response.set_header('content-type', 'text/plain; charset=utf-8')
    return api.ru('blacklist.txt')
예제 #6
0
def rss_echo(echo, year, num=50):
    cfg = api.load_echo(True)
    response.set_header('content-type', 'application/rss+xml; charset=utf-8')
    return rssg.gen_rss('%s.%s' % (echo, year), cfg[0][0], num)