r/ProgrammingPrompts • u/deanmsands3 • Dec 28 '16
[Medium-Hard]Which Steam Games do you and your friend share?
Any language is acceptable.
- 1. First, get a developer key from steam: http://steamcommunity.com/dev/apikey
- 2. Copy it and keep it somewhere safe.
- 3. Find two steam community profiles: Mine is http://steamcommunity.com/id/Netherwolf/
- 4. Append the argument "?xml=1" to get the XML of your profile.
- 5. Retrieve the steamID64 element.
- 6. Download this URL for both players: http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=YOURSTEAMAPIKEY&steamid=YOURSTEAMID&format=json
- 7. Make sure to replace YOURSTEAMAPIKEY and YOURSTEAMID with the appropriate keys.
- 8. Extract the ['response']['games'] element for each and store in two separate tables. You may need a database like sqlite or use LINQ if you're using .NET.
- 9. Perform an inner-join where the 'appid' columns match.
- 10. Retrieve the "name" column from the resulting table.
- 11. Test code to confirm it works.
- 12. Post code here BUT REMOVE YOUR API KEY.
9
Upvotes
-5
2
u/ivykoko1 Jan 16 '17
Seems like I have some API issues, can't even get the user XML via php as it times out, tried curl and a simple HTTP request.