Example #1
0
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)
Example #2
0
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
Example #3
0
def seasons():
    r = api.get(SEASONS_URL, paginated=False)
    session.get_collection('seasons').insert_many(r)
Example #4
0
def leagues():
    r = api.get(LEAGUES_URL, paginated=False)
    session.get_collection('leagues').insert_many(r)
Example #5
0
def countries():
    r = api.get(COUNTRIES_URL, paginated=False)
    session.get_collection('countries').insert_many(r)
Example #6
0
def continents():
    r = api.get(CONTINENTS_URL, paginated=False)
    session.get_collection('continents').insert_many(r)