Skip to content

Commit

Permalink
The old api used to fetch game's data is deprecated and no longer wor…
Browse files Browse the repository at this point in the history
…ks. This commit replaces it by a call to the new web API.
  • Loading branch information
pdroalves committed Jun 23, 2018
1 parent 454e6da commit 294c360
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions steam-appmanifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,22 @@ def onRefreshClick(self, widget):
if m:
appids.append( int( m.groups(1)[0] ) )

url = "http://steamcommunity.com/id/"+ self.steamid.get_text() +"/games?tab=all&xml=1"
# Get user's id
url_id64 = "http://steamcommunity.com/id/"+ self.steamid.get_text() +"/games?tab=all&xml=1"
html = urlopen(url_id64)
tree = ElementTree()
tree.parse(html)
steamID64 = tree.getiterator('steamID64')[0].text

# Get game data
url = "https://api.steampowered.com/ISteamApps/GetAppList/v0002/?key=" + steamID64 + "&format=xml"
html = urlopen(url)
tree = ElementTree()
tree.parse(html)
games_xml = tree.getiterator('game')
games_xml = tree.getiterator('app')

for game in games_xml:
appid = int(game.find('appID').text)
appid = int(game.find('appid').text)
name = game.find('name').text
exists = appid in appids
self.game_liststore.append([exists, appid, name])
Expand Down

0 comments on commit 294c360

Please sign in to comment.