diff options
-rw-r--r-- | SteamAPI.py | 9 | ||||
-rwxr-xr-x | main.py | 4 | ||||
-rw-r--r-- | templates/premades_html.jinja | 2 |
3 files changed, 5 insertions, 10 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') @@ -112,9 +112,9 @@ def lobby(): ip, port = gameserver.split(':') port = int(port) gameid = playerdata['gameid'] - print('Query Server:', ip, port, gameid) + # print('Query Server:', ip, port, gameid) server = QueryServer.QueryServer(ip, port, gameid) - print('Response:', server) + # print('Response:', server) if server: serverinfo[gameserver] = server diff --git a/templates/premades_html.jinja b/templates/premades_html.jinja index 548a451..8fc4043 100644 --- a/templates/premades_html.jinja +++ b/templates/premades_html.jinja @@ -27,7 +27,7 @@ var graph = Viva.Graph.graph(); {% for steamid in steamids %} - graph.addNode('{{ steamid }}', {url : '{{ profiles[steamid]['avatarmedium'] }}', name : '{{ profiles[steamid]['personaname']|e }}', friends : {% if profiles[steamid]['communityvisibilitystate'] == 3 %} 'yes' {% else %} 'no' {% endif %}}); + graph.addNode('{{ steamid }}', {url: '{{ profiles[steamid]['avatarmedium'] }}', name: '{{ profiles[steamid]['personaname']|e }}', link: '{{ profiles[steamid]['profileurl'] }}', friends: {% if profiles[steamid]['communityvisibilitystate'] == 3 %} 'yes' {% else %} 'no' {% endif %}}); {% endfor %} {% for connection in connections %} graph.addLink('{{ connection[0] }}', '{{ connection[1] }}'); |