Exemplo n.º 1
0
def codeforces():
    if 'cf_login' not in session:
        return redirect(url_for(settings))

    today = datetime.date.today()
    pr = CodeforcesProvider(session['cf_login'])
    return jsonify(pr.get_submissions(today))
Exemplo n.º 2
0
def cf_stats():
    if 'cf_login' not in session:
        return redirect(url_for(settings))

    result = {}
    name = session['cf_login']
    provider = CodeforcesProvider(name)
    now = datetime.date.today()
    result['daily'] = provider.get_stats_for_day(name, now)
    result['weekly'] = provider.get_stats_for_week(name)
    result['monthly'] = provider.get_stats_for_month(name)
    return jsonify({'result': result})