Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $api_key = '.......'; //Steam API Key, Required to work
- $lines = file('parse.txt'); //reads in the file with the list of user numbers
- $game_id = 550; //Steam Game ID, 440 is TF2
- foreach ($lines as $usernumber) { //loops line by line
- $link = 'http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=' . $api_key . '&steamid=' . $usernumber . '&format=json';
- $json = file_get_contents($link); //Reads link (this ^)
- $data = json_decode($json);
- foreach ($data->response->games as $game) {
- if ($game->appid == $game_id) {
- echo 'Playtime for ', $usernumber, ' is ' . $game->playtime_forever."<br>";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement