Exemple #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
Exemple #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
import config
from pinnacle_utility import set_headers, call_api

url = config.base_url + 'client/balance'
resp = call_api(url, 'JSON', set_headers())
if resp:
    print 'User Bal.', "%s$%s" % (resp["currency"], resp["availableBalance"])
    print('Open Bets',
          "%s$%s" % (resp["currency"], resp["outstandingTransactions"]))
else:
    print 'no data returned'
Exemple #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
Exemple #5
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
Exemple #6
0
def get_data():
    url = config.base_url + 'leagues?sportid=12'
    resp = call_api(url, 'XML', set_headers())
    print resp
    return resp
import config
from pinnacle_utility import set_headers, call_api

url = config.base_url + "client/balance"
resp = call_api(url, "JSON", set_headers())
if resp:
    print "User Bal.", "%s$%s" % (resp["currency"], resp["availableBalance"])
    print ("Open Bets", "%s$%s" % (resp["currency"], resp["outstandingTransactions"]))
else:
    print "no data returned"
Exemple #8
0
def get_data():
    url = config.base_url + 'leagues?sportid=12'
    resp = call_api(url, 'XML', set_headers())
    print resp
    return resp
Exemple #9
0
def get_data():
    url = config.base_url + 'sports'
    resp = call_api(url,'XML', set_headers())
    return resp