Example #1
0
def get_address():
    query = dict(request.query)
    url = query['q']
    data = get_jp_address(get_page_data(url))
    results = [{'address':x[0]} for x in data]
    response.set_header('Content-Type','application/json')
    return json.dumps(results, indent=2, sort_keys=True, ensure_ascii=False)
Example #2
0
def get_address_pt():
    query = dict(request.query)
    url = query['q']
    data = get_jp_address(get_page_data(url))
    response.set_header('Content-Type','text/plain')
    return '\n'.join([x[0] for x in data])