Skip to content

Instantly share code, notes, and snippets.

@wbills
Created May 4, 2017 14:40
Show Gist options
  • Select an option

  • Save wbills/c067ea98c03120e340a2b5296d823b6a to your computer and use it in GitHub Desktop.

Select an option

Save wbills/c067ea98c03120e340a2b5296d823b6a to your computer and use it in GitHub Desktop.
steam common games
import sys
import steamapi #https://github.com/smiley/steamapi
user_url=sys.argv[1]
api_key = sys.argv[2]
steamapi.core.APIConnection(api_key=api_key, validate_key=True)
u = steamapi.user.SteamUser(userurl=user_url)
friends = u.friends
friends.append(u)
games = {}
shared = {}
for f in friends:
for g in f.games:
if g.appid not in games:
games[g.appid] = g
if g.appid not in shared:
shared[g.appid] = []
shared[g.appid].append(f.name)
for g in shared:
if len(shared[g]) > 1:
print games[g].name + ": " + ', '.join(shared[g])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment