Ejemplo n.º 1
0
def create_league():
    access_token = session.get('access_token')
    league_type = request.args.get('league_type', 'nba', type=str)
    league_key = request.args.get('league_key', '', type=str)

    stats_data = yahoo.get_stats_categories(access_token, league_type)
    teams_data = yahoo.get_teams(access_token, league_key)

    league = League()
    league.parseStats(stats_data)
    league.parseTeams(teams_data)
Ejemplo n.º 2
0
def request_teams():
    access_token = session.get('access_token')
    league_key = request.args.get('league_key', '', type=str)
    r = yahoo.get_teams(access_token, league_key)

    return jsonify(json_util.parse("fantasy_content.leagues{0}.league[1]", r.json()))