def get_endpoint(endpoint='/tanks/stats/', lang='ru', fields='', account_id=''):
api = API()
if type(fields) is list:
fields = api._format_fields(fields)
return api._api_call(endpoint=endpoint,
fields=fields,
language=lang,
account_id=account_id)
def parse_this():
x = urllib.request.urlopen('http://www.example.com')
soup = BeautifulSoup(x)
return str(soup.body.p)
from flask import make_response
from functools import update_wrapper
def nocache(f):
def new_func(*args, **kwargs):
resp = make_response(f(*args, **kwargs))
resp.cache_control.no_cache = True
return resp
return update_wrapper(new_func, f)
@nocache
@app.route('/')
def main_page():
return parse_this()