/dev/null &"); } exit(file_get_contents($cache)); } // If the script was called locally we need to update the cache. Get all the anonymous proxy list pages. $pnum = 0; while ($pnum <= $maxpnum){ $page .= curl_func("http://www.xroxy.com/proxylist.php?type=Anonymous&pnum=$pnum"); preg_match_all('/pnum=(\d+)/', $page, $matches); $link = array_pop($matches[1]); $maxpnum >= $link or $maxpnum = $link; $pnum++; } // Match the port and get a link to the whois page which has the IP in plaintext. preg_match_all('/proxy-(\d+)-[^.]+.htm.*?(whois\d+\.htm)/s', $page, $matches, PREG_SET_ORDER); // Retrieve the whois page and match the IP foreach($matches as $key => $row){ $page = curl_func("http://www.xroxy.com/{$row[2]}"); if (preg_match('%((?:[0-9]{1,3}\.){3}[0-9]{1,3})%', $page, $match)){ // Check if the proxy is accepting connections and if so, add it to the list if ($fp = @fsockopen($match[1], $row[1], $errno, $errstr, 15)){ fclose($fp); $text .= "{$match[1]}:{$row[1]}\n"; } } } file_put_contents($cache, $text); ?>