I decided to try this to see if I could implement it into my league site, I've got the data and parsed it to some extent but I've come to a problem. I am using an array to get the names of the tracks but it only appears once for each person. This is my code:
<?
$TeamMembers = array("Leifde", "csimpok");
$trackValues = array( "000" => "Blackwood GP",
"001" => "Blackwood GP Rev",
"010" => "Blackwood Rallycross",
"011" => "Blackwood Rallycross Rev",
"100" => "South City Classic",
"101" => "South City Classic Rev",
"110" => "South City Sprint 1",
"111" => "South City Sprint 1 Rev",
"120" => "South City Sprint 2",
"121" => "South City Sprint 2 Rev",
"130" => "South City Long",
"131" => "South City Long Rev",
"140" => "South City Town",
"141" => "South City Town Rev",
"200" => "Fern Bay Club",
"201" => "Fern Bay Club Rev",
"210" => "Fern Bay Green",
"211" => "Fern Bay Green Rev",
"220" => "Fern Bay Gold",
"221" => "Fern Bay Gold Rev",
"230" => "Fern Bay Black",
"231" => "Fern Bay Black Rev",
"240" => "Fern Bay Rallycross",
"241" => "Fern Bay Rallycross Rev",
"250" => "Fern Bay Rallycross Green",
"251" => "Fern Bay Rallycross Green Rev",
"400" => "Kyoto Ring Oval",
"401" => "Kyoto Ring Oval Rev",
"410" => "Kyoto Ring National",
"411" => "Kyoto Ring National Rev",
"420" => "Kyoto Ring GP",
"421" => "Kyoto Ring GP Rev",
"500" => "Westhill International",
"501" => "Westhill International Rev",
"600" => "Aston Cadet",
"601" => "Aston Cadet Rev",
"610" => "Aston Club",
"611" => "Aston Club Rev",
"620" => "Aston National",
"621" => "Aston National Rev",
"630" => "Aston Historic",
"631" => "Aston Historic Rev",
"640" => "Aston GP",
"641" => "Aston GP Rev");
$x = 0;
$numMembers = count($TeamMembers);
$LFSRacerHL = array();
$LFSHotlap = "";
while ($x < $numMembers) {
$LFSHotlap = file_get_contents ("http://lfsworld.net/pubstat/get_stat2.php?action=hl&racer=".$TeamMembers[$x]);
if ($LFSHotlap == "no output" || $LFSHotlap == "can't reload this page that quickly after another") {
die("ERROR! LFSWORLD RETURNED:<br />".$LFSHotlap);
}
$LFSHotlap = nl2br($LFSHotlap);
$LFSHotlap = explode("<br />", $LFSHotlap);
$i = 0;
$LFSHotlapNum = count($LFSHotlap);
while ($i < $LFSHotlapNum) {
$LFSRacerHL[$x][$i] = explode(" ", $LFSHotlap[$i]);
$i++;
}
$x++;
sleep("5");
}
$x = 0;
$i = 0;
print "<center><table border=\"1\" cellspacing=\"0\" cellpadding=\"2\"><tr><td><b>Driver Name</b></td><td><b>Track</b></td><td><b>Car</b></td><td><b>Time</b></td></tr>";
foreach ($LFSRacerHL as $key => $value) {
foreach ($LFSRacerHL[$key] as $key2 => $value2) {
print "<tr><td>".$TeamMembers[$key]."</td>";
foreach ($LFSRacerHL[$key][$key2] as $key3 => $value3) {
if ($key3 == 0) {
$newValue3 = $trackValues[$value3];
print "<td>".$newValue3."</td>";
} else {
print "<td>".$value3."</td>";
}
}
print "</tr>";
}
}
print "</table></center>";
?>
I'm using me and csimpok. (csimpok has a lot of hotlaps uploaded which is why I chose him)
The output is
here.