Yeah, i was working on it:
<?php
if( !isset($_GET['name']) || empty($_GET['name']) )
{
$_GET['name'] = 'Deathfired';
}
$line_to_find = "<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR=#505050><TD COLSPAN=2 CLASS=white><B>Character Information";
$line_to_delete = "<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR=\"#505050\" CLASS=white><B>Search Character";
$url = "http://www.tibia.com/community/?subtopic=character&name=".$_GET['name'];
$contents = file_get_contents($url);
$contents = stristr($contents, $line_to_find);
$delete = stristr($contents, $line_to_delete);
$contents = str_replace($delete, '', $contents);
$name_string = stristr($contents, "<TD WIDTH=20%>Name:</TD><TD>");
$proffession = stristr($contents, "Profession:</TD><TD>");
$level_string = stristr($contents, "<TR BGCOLOR=#D4C0A1><TD>Level:</TD><TD>");
$guild_string = stristr($contents, "<TR BGCOLOR=#F1E0C6><TD>World:</TD><TD>"); // I used the World: value here.
//$char_deaths = stristr($contents, "");
$name = substr($name_string, 28, strlen($_GET['name']));
$prof = substr($proffession, 20, strpos($proffession, "</TD>", 20)-20);
$level = substr($level_string, 39, strpos($level_string, "</TD>", 39)-39);
$guild = substr($guild_string, 39, strpos($guild_string, "</TD>", 39)-39);
$beginning = stristr($contents, 'Character Deaths');
$ending = stristr($beginning, '</TABLE>');
$character_deaths = str_replace($ending, '', $beginning);
$deaths = explode('</TR>', $character_deaths);
$x = 0;
$i = 0;
for($i; $i<count($deaths); $i++)
{
if( (stristr($deaths[$i], 'Character Deaths') === FALSE) &&
(stristr($deaths[$i], '</TABLE>') === FALSE) &&
($deaths[$i] !== ' ') )
{
$x++;
list($killed[$x], $killedby[$x]) = explode('</TD><TD>', $deaths[$i]);
$killed[$x] = str_replace('<TR BGCOLOR=#F1E0C6><TD WIDTH=25%>', '', $killed[$x]);
$killed[$x] = str_replace('</TD><TD>', '', $killed[$x]);
$killedby[$x] = substr($killedby[$x], 0, strpos($killedby[$x], '</TD>'));
$death[$x] = $killed[$x].' '.$killedby[$x];
}
}
echo '<b>Name:</b> '.$name.'<br>'."\n".
'<b>Profession:</b> '.$prof.'<br>'."\n".
'<b>Level:</b> '.$level.'<br>'."\n".
'<b>Guild:</b> '.$guild."<br>\n";
echo "<b>Deaths:</b>";
if($death[$x] == '' || $death[$x] == " " || $death[$x] == " ")
{
unset($death[$x]);
$x--;
}
if($x != 0)
{
for($i=1; $i<$x; $i++)
{
echo "<br />\n".$death[$i];
}
}
else
{
echo " No Deaths Recorded.";
}
?>
Viewable Here (Seteus)
Viewable Here (Deathfired)
~Brett