-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.php
More file actions
60 lines (49 loc) · 1.75 KB
/
api.php
File metadata and controls
60 lines (49 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
class IPlayerService
{
//GetSteamLevel
//For more information, visit https://partner.steamgames.com/doc/webapi/IPlayerService#GetSteamLevel
function GetSteamLevel($apikey, $userid)
{
$api_url = "https://api.steampowered.com/IPlayerService/GetSteamLevel/v1/?key=" . $apikey . "&steamid=" . $userid;
$json = json_decode(file_get_contents($api_url) , true);
return $json['response'];
}
//GetBadges
//For more information, visit https://partner.steamgames.com/doc/webapi/IPlayerService#GetBadges
function GetBadges($apikey,$userid,$param,$array)
{
$api_url = "https://api.steampowered.com/IPlayerService/GetBadges/v1/?key=" . $apikey . "&steamid=" . $userid;
$json = json_decode(file_get_contents($api_url) , true);
switch ($param)
{
case "getall":
return var_dump($json['response']['badges'][0]);
break;
case "count":
return $json['response']['badges'];
break;
default;
return $json['response']['badges'][$array][$param];
}
}
}
class ISteamUser
{
//GetPlayerSummaries
//For more information, visit https://partner.steamgames.com/doc/webapi/ISteamUser#GetPlayerSummaries
function GetPlayerSummaries($apikey, $userid, $param)
{
$api_url = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=" . $apikey . "&steamids=" . $userid;
$json = json_decode(file_get_contents($api_url) , true);
switch ($param)
{
case "getall":
return var_dump($json['response']['players'][0]);
break;
default;
return $json['response']['players'][0][$param];
}
}
}
?>