steam_stats /steam_source_stats.php

Language PHP Lines 76
MD5 Hash da85358cb65f6c4aec857c35fee18baa Estimated Cost $656 (why?)
Repository https://bitbucket.org/davestj/steam_stats.git View Raw File View Project SPDX
 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
67
68
69
70
71
72
73
74
75
<?php
/*
steamcast xml source stats api
Author: dstjohn (Mediacast1)
Date started: 04-06-2005 (1:00A.M)
Version: LNV  (LATE NIGHT VERSION) 1.0 beta
NOTES:
This script is intended to get stats from one source of a steamcast server,
if there is more then one source you will need to add and hack this script,
your own your own and may the code be with you ;)
*/
/************************************************************************************/
include("./config.php");
//connect to server
$fp = fsockopen($steamip,$steamport,&$errno,&$errstr, 30);

if(!$fp) {
  $steam_success = 1;
echo 'Server Is Down';
}
 
if($steam_success != 1){
fputs ($fp, "GET /admin/status.xml HTTP/1.1\r\n .
User-Agent: Steamcast XML Parser (author: davestj@casterclub.com)(Mozilla Compatible)\r\n .
Authorization: Basic ".base64_encode ("$adminuser:$adminpass")."\r\n\r\n"); 
 while(!feof($fp)) {
  $steam_page .= fgets($fp, 1000);
 }
/************************************************************************************/
//parse out source xml data
//"description",
 $loop2 = array("mount", "status", "name", "description", "genre", "url", "bitrate",
 "meta_song", "meta_url", "nodes", "unique_nodes", "max_nodes", "average_connect_time", "tuneins", "extended_tuneins",
 "connect_time", "bandwidth", "bytes_recv", "bytes_sent", "content_type", "backup");
 $x=0;
 while($loop2[$x] != ''){
  $steam_pageed = ereg_replace(".*<$loop2[$x]>", "", $steam_page);
  $steam_php = strtolower($loop2[$x]);
  $$steam_php = ereg_replace("</$loop2[$x]>.*", "", $steam_pageed);
 if($loop[$y]==genre || $loop[$y]==description || $loop[$y]==meta_song){
   $$steam_php = urldecode($$steam_php);
 }

// uncomment the next line to see all variables
  echo'$'.$steam_php.' = '.$$steam_php.'<br>';
  $x++;
 }

fclose($fp);
}
//end xml parse

/************************************************************************************/
/*
available php variables for this api
$mount
$status
$name
$description
$genre
$url
$bitrate
$meta_song
$meta_url
$nodes
$max_nodes
$average_connect_time
$tuneins
$extended_tuneins
$connect_time
$bytes_recv
$content_type
*/

?>
Back to Top