Ejemplo n.º 1
0
def get_data():
    #url = base_url() + 'odds?sportId=12&leagueids=9652&oddsFormat=DECIMAL'
    params = 'odds?sportId=12&leagueid=%s&oddsFormat=DECIMAL' % league_lol()
    url = config.base_url + params
    resp = call_api(url, 'JSON', set_headers())
    if resp:
        for league in resp["leagues"]:
            print "\n\nLEAGUE : ", league["id"]
            for event in league["events"]:
                #print(event["periods"])
                period = event["periods"][0]
                if period:
                    print ("Line : %s with Cutoff %s" % 
                           (period["lineId"], period["cutoff"]))
                    if 'moneyline' in period:
                        print ("\t N/ODDS are Team1 %s VS Team2 %s " %
                               (period["moneyline"]["home"],
                               period["moneyline"]["away"]))
                    elif 'spreads' in period:
                        print ("\t H/ODDS are Team1 %s VS Team2 %s " %
                               (period["spreads"][0]["home"],
                               period["spreads"][0]["away"]))
    return resp
Ejemplo n.º 2
0
def get_data():
    #url = base_url() + 'odds?sportId=12&leagueids=9652&oddsFormat=DECIMAL'
    params = 'odds?sportId=12&leagueid=%s&oddsFormat=DECIMAL' % league_lol()
    url = config.base_url + params
    resp = call_api(url, 'JSON', set_headers())
    if resp:
        for league in resp["leagues"]:
            print "\n\nLEAGUE : ", league["id"]
            for event in league["events"]:
                #print(event["periods"])
                period = event["periods"][0]
                if period:
                    print("Line : %s with Cutoff %s" %
                          (period["lineId"], period["cutoff"]))
                    if 'moneyline' in period:
                        print("\t N/ODDS are Team1 %s VS Team2 %s " %
                              (period["moneyline"]["home"],
                               period["moneyline"]["away"]))
                    elif 'spreads' in period:
                        print("\t H/ODDS are Team1 %s VS Team2 %s " %
                              (period["spreads"][0]["home"],
                               period["spreads"][0]["away"]))
    return resp
Ejemplo n.º 3
0
def get_data():
    SPORT_ID = '12'
    url = config.base_url + 'fixtures?sportId=' + SPORT_ID + '&leaguesids=' + league_lol(
    )
    resp = call_api(url, 'JSON', set_headers())
    return resp
Ejemplo n.º 4
0
def get_data():
    SPORT_ID = "12"
    url = config.base_url + "fixtures?sportId=" + SPORT_ID + "&leaguesids=" + league_lol()
    resp = call_api(url, "JSON", set_headers())
    return resp