url = $characterPageUrl; $this->html = $this->getPageContents(); $this->parse(); } function getStat($name) { return (isset($this->stats[$name])) ? $this->stats[$name] : 0; } private function getPageContents() { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $this->url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); $contents = curl_exec($curl); curl_close($curl); //handle httpCodes and other failures return $contents; } }