RussellReal commented on a Page, PHP RuneScape stat function.  -  Sep 18, 2007

// Same as what I described in the introduction to the snippet, but for the \"slower\" people, here it is all the way done.
function getStats($n) {
$d = file_get_contents(\"http://hiscore.runescape.com/lang/en/aff/runescape/hiscorepersonal.ws?user1=\".$n);
preg_match_all(\"/<td align=\\\"left\\\">(.*?)<\\/tr>/s\",$d,$m);
$u = array(\"\\n\",\"\\r\");
$g = array(\'/^\\s+/\',\'/\\s{2,}/\');
$o = array(\'\',\' \');
$s = array();
foreach ($m[1] as $v) {
$ta = explode(\" \",preg_replace($g,$o,str_replace($u,\' \',strip_tags($v))));
$line .= $ta[2];
$s[$ta[0]] = array(\'Rank\' => $ta[1],\'Level\' => $ta[2],\'Exp\' => $ta[3]);
}
return (($s[\'Overall\'][\'Level\'] == \"does\")? \"false\":$s);
}
$variable = getStats($_GET[\'rsn\']);
foreach ($variable as $skill => $v) {
$line = $skill;
foreach ($variable[$skill] as $aspect => $data) {
$line .= \" \".$aspect.\": \".$data;
}
echo $line.\"\\n\";
}

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.