Here are two handy functions to use in getting the games and friend count for a steam profile.
To count the games owned amount for a steam profile use:
function game_count($steamid)
{
$data = json_decode(file_get_contents("https://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=YOURAPIKEY&steamid=" . $steamid . "&include_played_free_games=0&include_appinfo=1"));
$games_count = $data->response->game_count;
return $games_count;
}
echo game_count('754686934578698'); To count the friends a steam profile has use:
function friend_count($steamid)
{
$data = json_decode(file_get_contents("https://api.steampowered.com/ISteamUser/GetFriendList/v0001/?key=YOURAPIKEY&steamid=" . $steamid . "&relationship=friend"));
$friends_count = count($data->friendslist->friends);
return $friends_count;
}
echo friend_count('754678978080'); Dont forget to replace YOURAPIKEY with your steam apikey
A drained and empty Kennington reservoir images from a drone in early July 2024. The…
Merrimu Reservoir from drone. Click images to view larger.
Some early September spring shots from a bushwalk, It is still too early for wildflowers.
I recently needed to clone over a smaller NVMe to a 2TB SK Hynix Platinum…
If you ever needed a simple solution in Laravel to delete an entire directory and…
How to enforce only one user to register or be registered in a Laravel web…