GamesTV stats parser

I got idea to make application to get multikills times from gtv stats - like mediamanager
i wrote it in PHP: http://pastebin.com/z56kKecM
but it doesnt work well and Im too lazy to debug it so if any1 can help me finish it...

it could be done easily just by searching kill but i also want which map was played and which round
u could make it in C or whatever u want of course :)

...of course best solution could be that gtv admins would implement it directly in gtv
Comments
8
media maneger doesnt work well aswell

so good job!
great idea, if this work out every moviemaker gonna have big banana smile on face.. no more demo research
great idea :O
make another movie instead of this
movie took me 1 month and this few hours
but im thinking about making community movie with more moviemakers, so ill just make one part, because i dont wanna make anything longer than 3 minutes
if any1 would be interested
Parent
Unknown paste idea
Idea? ID I mean:>
Parent
<style>

/* ET color codes */
span.cp { color: #000000; }
span.cq { color: #ff0000; }
span.cr { color: #00ff00; }
span.cs { color: #dddd00; }
span.ct { color: #0000ff; }
span.cu { color: #00ffff; }
span.cv { color: #ff00ff; }
span.cx { color: #ffa500; }
span.cy { color: #808080; }
span.cb { color: #008080; }
span.cc { color: #800080; }
span.cd { color: #0066cc; }
span.ce { color: #6600cc; }
span.cf { color: #3399cc; }
span.cg { color: #ccffcc; }
span.ch { color: #006633; }
span.ci { color: #990033; }
span.cj { color: #993333; }
span.ck { color: #993300; }
span.ca { color: #cc9966; }
span.cm { color: #999966; }
span.cn { color: #cccc99; }
span.co { color: #cccc66; }


/* end */

fieldset {
border: 2px solid #FFD292;
border-radius: 10px;
}

</style>
<?
function br()
{
echo "</br>\n";
}
//page generating time
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;


$url='http://www.gamestv.org/event/33955-dead-ringers-vs-to-make-odds-even/'.'statistics';
$a = file_get_contents($url);
echo "<a href=\"$url\" >$url</a>";
br();
$map_c=1;
$stats_start=strpos($a,"<div class=\"matchStats\"");
$a=substr($a,$stats_start,strpos($a,"View plaintext endround stats")-$stats_start); //cuts content to only data i need
$c=strlen($a);
$l=strpos($a,'" class="k">');
while (!$l===false)
{
//echo $l;br();
//echo strlen($a);br();
$name_pos=strpos($a,'<td class="left playername">'); //this text is always before player name
$map_pos=strpos($a,'</legend><table rules="groups"'); //this text is always after map name
if ($l>$map_pos)
{
echo substr($a,strrpos(substr($a,0,$map_pos),' '),$map_pos-strrpos(substr($a,0,$map_pos),' '));br();
$map_c++;
}
if ($l>$name_pos)
{
$offs=strpos(substr($a,$name_pos),"</td>");
echo substr($a,$name_pos+28,$offs-28).":";br();
}
//parsing time
$kill=substr($a,strrpos(substr($a,0,$l),'<span title="')+13,$l-13-strrpos(substr($a,0,$l),'<span title="'));
$timek=substr($kill,strrpos($kill,'(')+1,strrpos($kill,')')-1-strrpos($kill,'('));
$token=strtok($timek, ':');
$m = $token;
$token=strtok(":");
$s=$token;
$time_s=$m+60*s;
echo $kill."__".$m.":".$s;
br();
$a=substr($a,$l+1); //cutting content

$l=strpos($a,'" class="k">');

}
?>

<?php
//page generating time
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
echo 'Page generated in '.$total_time.' seconds.';
?>
Parent
Back to top