-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSteamPrivateAPI.php
More file actions
66 lines (57 loc) · 1.45 KB
/
SteamPrivateAPI.php
File metadata and controls
66 lines (57 loc) · 1.45 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
59
60
61
62
63
64
65
66
<?php
namespace Neoseeker\SteamAPI;
use Curl\Curl;
class SteamPrivateAPI {
var $url = "http://api.steampowered.com/";
private function request($url, $data) {
$curl = new Curl();
$curl->get($url, $data);
$response = $curl->response;
$http_response_header = $curl->httpStatusCode;
$curl->close();
if ($http_response_header == 200) {
return $response;
}
return null;
}
public function get_player_summaries($steamid) {
if (!is_numeric($steamid)) {
return null;
}
return $this->request($this->url."ISteamUser/GetPlayerSummaries/v0002/", array(
'key' => STEAM_API_KEY,
'steamids' => $steamid,
));
}
public function get_player_achievements($appid, $steamid) {
if (!is_numeric($appid) || !is_numeric($steamid)) {
return null;
}
return $this->request($this->url."ISteamUserStats/GetPlayerAchievements/v0001/", array(
'appid' => $appid,
'key' => STEAM_API_KEY,
'steamid' => $steamid,
'l' => 1,
));
}
public function get_schema_for_game($appid) {
if (is_numeric($appid)) {
return $this->request($this->url."ISteamUserStats/GetSchemaForGame/v2/", array(
'appid' => $appid,
'key' => STEAM_API_KEY,
));
}
return null;
}
public function get_owned_games($steamid) {
if (is_numeric($steamid)) {
return $this->request($this->url."IPlayerService/GetOwnedGames/v0001/", array(
'steamid' => $steamid,
'key' => STEAM_API_KEY,
'include_appinfo' => 1,
));
}
return null;
}
}
?>