summaryrefslogtreecommitdiff
path: root/SteamAPI.py
diff options
context:
space:
mode:
authorAndré Glüpker <git@wgmd.de>2018-01-06 21:18:51 +0100
committerAndré Glüpker <git@wgmd.de>2018-01-06 21:18:51 +0100
commitf3a988f588da40cd9a444dca49f5269803e12ae4 (patch)
treec9e079755155aa9342faf3cbdb508e20626efbc4 /SteamAPI.py
parentfd3e38f818d1cf29fb71820afa0a65e61a875a20 (diff)
downloadsteam-f3a988f588da40cd9a444dca49f5269803e12ae4.tar.gz
steam-f3a988f588da40cd9a444dca49f5269803e12ae4.tar.bz2
steam-f3a988f588da40cd9a444dca49f5269803e12ae4.zip
Some code cleanup
Diffstat (limited to 'SteamAPI.py')
-rw-r--r--SteamAPI.py9
1 files changed, 2 insertions, 7 deletions
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')