Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib2
- import json
- gameslist = []
- key = '' # http://steamcommunity.com/dev/apikey
- steamid = '' # steam64 id, example: 76561198077896435
- url = 'http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=' + key + '&steamid=' + steamid + '&format=json'
- applist = 'http://api.steampowered.com/ISteamApps/GetAppList/v2'
- print "Retrieving user data..",
- response = urllib2.urlopen(url)
- userdata = json.load(response)
- print " ok"
- print "Retrieving app data.. (might take a while)",
- response = urllib2.urlopen(applist)
- appdata = json.load(response)
- print " ok"
- for i in userdata["response"]["games"]:
- for p in appdata["applist"]["apps"]:
- if p["appid"] == i["appid"]:
- gameslist.append(p["name"].encode("utf-8"))
- print "Saving to file..",
- f = open(steamid + '.txt', 'wb')
- f.write('\n'.join(gameslist))
- f.close()
- print " ok"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement