def getMatchDetails(match_id): get_player_url = 'http://api.paladins.com/paladinsapi.svc/getmatchdetailsjson' file_data = ses.getPreviousSession() sig = ses.signature('getmatchdetails', file_data['datetime']) url = get_player_url + '/' + env.devID + '/' + sig + '/' + file_data[ 'session_id'] + '/' + file_data['datetime'] + '/' + str(match_id) contents = json.loads(urllib.request.urlopen(url).read().decode('utf-8')) return contents
def getPlayer(player): get_player_url = 'http://api.paladins.com/paladinsapi.svc/getplayerJson' file_data = ses.getPreviousSession() sig = ses.signature('getplayer', file_data['datetime']) url = get_player_url + '/' + env.devID + '/' + sig + '/' + file_data[ 'session_id'] + '/' + file_data['datetime'] + '/' + player contents = urllib.request.urlopen(url).read() return json.loads(contents.decode('utf-8'))[0]
def checkApiLimits(): limit_url = 'http://api.paladins.com/paladinsapi.svc/getdatausedJson' file_data = ses.getPreviousSession() sig = ses.signature('getdataused', file_data['datetime']) url = limit_url + '/' + env.devID + '/' + sig + '/' + file_data[ 'session_id'] + '/' + file_data['datetime'] contents = json.loads(urllib.request.urlopen(url).read().decode('utf-8')) return contents[0]
def getServerStatus(): server_stat_url = 'http://api.paladins.com/paladinsapi.svc/gethirezserverstatus' file_data = ses.getPreviousSession() sig = ses.signature('gethirezserverstatus', file_data['datetime']) url = server_stat_url + '/' + env.devID + '/' + sig + '/' + file_data[ 'session_id'] + '/' + file_data['datetime'] contents = json.loads(urllib.request.urlopen(url).read().decode('utf-8')) return contents[0]
def getChampionRanks(player): get_player_url = 'http://api.paladins.com/paladinsapi.svc/getchampionranksJson' file_data = ses.getPreviousSession() sig = ses.signature('getchampionranks', file_data['datetime']) url = get_player_url + '/' + env.devID + '/' + sig + '/' + file_data[ 'session_id'] + '/' + file_data['datetime'] + '/' + str( getPlayer(player)['Id']) contents = json.loads(urllib.request.urlopen(url).read().decode('utf-8')) return contents