Файл: inc/tools/proxy_extractor/extract.php
Строк: 13
<?php
if(is_file('./urllist.txt'))
{
@unlink('proxy.txt');
$urlarray=array_map("trim", file('./urllist.txt'));
//count($urlarray)
for ($i=0; $i<count($urlarray); $i++)
{
ob_flush(); flush();
$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL, $urlarray[$i]);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$html=curl_exec($ch);
curl_close($ch);
preg_match_all("/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}:[0-9]{1,5}/", $html, $shtuk);
if(is_array($shtuk[0]))
{
$fs=fopen('./proxy.txt', "a");
foreach ($shtuk[0] as $proksea)
{
fwrite ($fs, $proksea."rn");
}
fclose($fs);
}
echo "URL: <a href=$urlarray[$i] target='_blank'>$urlarray[$i]</a> - Найдено прокси: <b>".count($shtuk[0])."</b> <br>";
}
}
?>