- <?php
-
- //--> Fonction
- function find_proxy($url){
- if(!$fp = @fopen($url, "r")) return false;
- $page = "";
- while(!feof($fp)) $page .= @fgets($fp, 4096);
- @fclose($fp);
- $proxy = array();
- $temp = tmpfile();
- @fwrite($temp, html_entity_decode($page));
- fseek($temp, 0);
- while(!feof($temp)){
- $line = trim(fgets($temp, 2048));
- if (ereg("([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}):([0-9]{2,4})", $line, $oct))
- $proxy[] = $oct[1].".".$oct[2].".".$oct[3].".".$oct[4].":".$oct[5];
- }
- @fclose($temp);
- if(count($proxy) <= 0) return false;
- return $proxy;}
-
- //--> Utilisation
- if($proxys = find_proxy("http://samair.ru/proxy/index.htm")){
- foreach($proxys as $proxy){
- echo("$proxy<br>\n");}
- }
- else{
- echo("Aucun proxy trouvé sur $url");}
-
- ?>
<?php
//--> Fonction
function find_proxy($url){
if(!$fp = @fopen($url, "r")) return false;
$page = "";
while(!feof($fp)) $page .= @fgets($fp, 4096);
@fclose($fp);
$proxy = array();
$temp = tmpfile();
@fwrite($temp, html_entity_decode($page));
fseek($temp, 0);
while(!feof($temp)){
$line = trim(fgets($temp, 2048));
if (ereg("([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}):([0-9]{2,4})", $line, $oct))
$proxy[] = $oct[1].".".$oct[2].".".$oct[3].".".$oct[4].":".$oct[5];
}
@fclose($temp);
if(count($proxy) <= 0) return false;
return $proxy;}
//--> Utilisation
if($proxys = find_proxy("http://samair.ru/proxy/index.htm")){
foreach($proxys as $proxy){
echo("$proxy<br>\n");}
}
else{
echo("Aucun proxy trouvé sur $url");}
?>