_url = $url; $this -> _cookie = $cookie; } function getpagedata( $url ) { $header = $this -> _header[ rand( 0, count( $this -> _header ) - 1 ) ]; $ch = curl_init(); curl_setopt( $ch, CURLOPT_HEADER, false ); curl_setopt( $ch, CURLOPT_URL, $url ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch, CURLOPT_REFERER, 'www.google.pl' ); curl_setopt( $ch, CURLOPT_USERAGENT, $header ); curl_setopt( $ch, CURLOPT_PROXY, $this -> _proxy ); curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 10 ); curl_setopt( $ch, CURLOPT_TIMEOUT, 10 ); curl_setopt( $ch, CURLOPT_COOKIE, $this -> _cookie ); curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $ch, CURLOPT_MAXREDIRS, 5 ); curl_setopt( $ch, CURLOPT_ENCODING, "gzip,deflate" ); $data = curl_exec( $ch ); curl_close( $ch ); return $data; } function pause() { usleep( rand( $this -> _time1, $this -> _time2 ) ); } function initGoogle() { return $this -> getpagedata( $this -> _url ); return $google; } }