class = $this->findClass();
$this->parseStats();
}
private
function findClass() {
preg_match('{(.*?)}', $this->html, $class);
return str_replace(' ', '', strtolower($class[1]));
}
function parseStats() {
preg_match_all('{
(.*?):<\/span> (.*?)<\/span><\/nobr><\/div>}', $this->html, $attributes);
for($i = 0; $i < count($attributes[0]); $i++) {
$attributes[2][$i] = str_replace(',', '', $attributes[2][$i]);
if(preg_match('/%/', $attributes[2][$i]) > 0) {
$attributes[2][$i] = str_replace('%', '', $attributes[2][$i]);
$attributes[2][$i] /= 100;
}
$this->stats[$attributes[1][$i]] = $attributes[2][$i];
}
}
}