Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from time import sleep
- from pypubg import core
- API = core.PUBGAPI("YOUR KEY HERE") # Get a key here: https://pubgtracker.com/site-api
- #players = ["Duckle29", "Duckle29"]
- result_list = []
- for player in players:
- result_list.append(API.player(player))
- if 'error' in result_list[-1]:
- print("Error retrieving stats for player {}: {}".format(player, result_list[-1]['message']))
- del result_list[-1]
- sleep(1)
- season = None
- #season = 'All'
- for RESULT in result_list:
- if season is None:
- season = RESULT['defaultSeason']
- max_rating = 0.0
- for stat in RESULT['Stats']:
- if stat['Season'] == season or season == 'All':
- for datas in stat['Stats']:
- if datas['label'] == 'Rating':
- if float(datas['value']) > max_rating:
- max_rating = float(datas['value'])
- print(" {} : {}".format(RESULT['PlayerName'], max_rating))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement