quote:
Originally posted by Guillaume
its too hard... i need something like XML
Is it possible to just take a picture (like 5 secs after object is loaded) of a swf object?
ok I've added a simple parseing thing to the code i gave before
code:
<?
$handle = fopen("http://www.bungie.net/Stats/PlayerStats.aspx?player=guyguyme2003", "rb");
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
$match = InsideTags('<div class="ExpBar" style="width:50"><div class="ExpBarText" style="left:20">','</div></div>',$contents); // uses a regular expression and gets the stuff inbetween those two points and returns it
foreach ($match[1] as $stat){ //just echo's all your stats
echo "$stat <br>";
}
function InsideTags($tag1,$tag2,$html){ //function to grab text inbetween two points
$tag2 = str_replace('/', "\/" ,$tag2);
preg_match_all("/$tag1(.*)$tag2/i", $html, $match);
return $match;
}
?>
now when that script above is run it will goto
http://www.bungie.net/Stats/PlayerStats.aspx?player=guyguyme2003 download the whole page and inserts it into $contents.
then because the stats are displayed in the html like so
code:
<div class="ExpBar" style="width:50"><div class="ExpBarText" style="left:20">3</div></div>
my code grabs the text inbetween the points
code:
<div class="ExpBar" style="width:50"><div class="ExpBarText" style="left:20">
and
code:
</div></div>
and then puts then in a varible called $match[1] ( $match[0] array holds the whole html of the stat lines )
then it prints all the stats out in order
so currently the script will print out
code:
3
4
1
9
5
It should be easy for you to assign every thing in $match[1] to varibles then print it to your image.
edit:
and also you will need to cache the stats because you dont want it to download your stat page everytime someone vists your image.