From f3a988f588da40cd9a444dca49f5269803e12ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Gl=C3=BCpker?= Date: Sat, 6 Jan 2018 21:18:51 +0100 Subject: Some code cleanup --- SteamAPI.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'SteamAPI.py') diff --git a/SteamAPI.py b/SteamAPI.py index cc67f20..47efe1a 100644 --- a/SteamAPI.py +++ b/SteamAPI.py @@ -70,10 +70,9 @@ class SteamAPI(): for steamid in cachedids: steamids_copy.remove(steamid) - if len(steamids_copy): + if steamids_copy: steamidlist = ','.join([str(x) for x in steamids_copy]) - url = 'https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?format=json&key=%s&steamids=%s' % (self.token, steamidlist) - # print(url) + url = 'https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?format=json&key=%s&steamids=%s' % (self.token, steamidlist) response = urlopen(url) if response.status != 200: print('Isn\'t this an HTTPError?') @@ -120,7 +119,6 @@ class SteamAPI(): return json.loads(cache) url = 'https://api.steampowered.com/ISteamUser/GetFriendList/v0001/?key=%s&steamid=%s&relationship=friend' % (self.token, str(steamid)) - # print(url) try: response = urlopen(url) data = response.read().decode('utf-8') @@ -214,11 +212,8 @@ class SteamAPI(): if cache: jsondata = json.loads(cache) return jsondata - else: - print('nocache') url = 'http://api.steampowered.com/ISteamUserStats/GetPlayerAchievements/v0001/?key=%s&steamid=%s&appid=%s' % (self.token, str(steamid), str(gameid)) - print(url) try: response = urlopen(url) data = response.read().decode('utf-8') -- cgit v1.2.3