With Bojero making custom sigs by scraping the stats page, I decided to open up the stats data a bit more, so I knocked up an API to allow access to player data.
The API is a simple HTTP GET based thing that returns JSON strings. Currently only player info is available, but if you would like other data, let me know and I'll slap it in there.
As an example of what player data is available atm, check this link:
http://jbnc.net/stats/json.phpAccess to the stats api is by application only, but it is of course free.
So, any developers out there feel like doing something interesting with the stats info, post in this thread or PM me and I'll provide you with an API key and a very brief PHP example of how to consume it.
Cheers,
Chilly
Comments
{
$JSON = file_get_contents('http://www.pvkstats.com/api/player.php?sid=' . $steamID . '&key=' . $apiKey);
$data = json_decode($JSON, true);
return $data;
}
That's basically all you need, then all the data is accessible via the array.
This be for programmers, don't worry yer head over it.
If it helps I can change all your names again.
import demjson
def getData(steamID, apiKey):
url = 'http://www.pvkstats.com/api/player.php?sid=%s&key=%s' % (steamID, apiKey)
connection = urllib.urlopen(url)
data = demjson.decode(connection.read())
return data
player = getData('STEAM_0:1:13732759', 'yourKeyHere') #Using my SteamID as an example...
server = player['favServers'][0]['name']
name = player['name']
print '%s\'s favourite server is %s!;)' % (name, server)