def fixtures_by_date(start_date, end_date): include = 'localTeam, visitorTeam, substitutions, goals, cards, other, corners, lineup, bench, sidelined, stats,' \ ' comments, tvstations, highlights, league, season, round, stage, referee, events, venue, odds, ' \ 'flatOdds, inplay, localCoach, visitorCoach, group, trends' url = FIXTURES_URL + "/between/" + start_date + '/' + end_date # url = FIXTURES_URL + "/date/" + start_date print(url) r = api.get(url, include, paginated=False) print(len(r)) session.get_collection('fixtures').insert_many(r)
def rounds(): include = 'results' seasons = session.get_collection('seasons').find({}, {'id': True}) for s in seasons: id_season = s['id'] url = ROUNDS_URL + '/season/' + str(id_season) print(url) r = api.get(url, include, paginated=False) try: session.get_collection('rounds').insert_many(r) except Exception: pass
def seasons(): r = api.get(SEASONS_URL, paginated=False) session.get_collection('seasons').insert_many(r)
def leagues(): r = api.get(LEAGUES_URL, paginated=False) session.get_collection('leagues').insert_many(r)
def countries(): r = api.get(COUNTRIES_URL, paginated=False) session.get_collection('countries').insert_many(r)
def continents(): r = api.get(CONTINENTS_URL, paginated=False) session.get_collection('continents').insert_many(r)