Skip to content

Instantly share code, notes, and snippets.

@ammarfaizi2
Created April 8, 2019 09:36
Show Gist options
  • Save ammarfaizi2/1528ba011b0c2b452f82f1ba1b53eddf to your computer and use it in GitHub Desktop.
Save ammarfaizi2/1528ba011b0c2b452f82f1ba1b53eddf to your computer and use it in GitHub Desktop.
<?php
$no = 1;
// $oci = "170.79.16.19:8080";
// test die proxy
$oci = "111:111:111:111:123";
$url = "https://mycoins.global/?friend/63025970027154";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, $oci);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
$response = curl_exec($ch);
$error = curl_error($ch);
$errno = curl_errno($ch);
//$info = curl_getinfo($ch);
//echo $response;
//print_r ($response);
//$info = curl_getinfo($ch);
//curl_close($ch);
//print_r ($info);
if(!$errno) {
preg_match_all("'<font color=red>(.*?)</font>'si", $response, $hasil);
$result['hasil']= $hasil;
//var_dump($hasil);
echo "\n". $no ."|". $oci ." | ".date("G:i:s")." | ". $oci[$i] . ' =>';
echo ($hasil[1][0]) . PHP_EOL;
/*
$hasil = array(
foreach ($hasil as $key => $val) {
echo $val;
}
*/
} else {
$error = ($error === "" ? "Proxy is dead" : $error);
$result['hasil']= "Curl Error: ({$errno}) {$error}";
echo "\n". $no ."|". $oci ." | ".date("G:i:s")." | => ".$result['hasil'].''. PHP_EOL;
}
//print_r ($hasil[1]);
//print_r ($hasil);
//echo "\n". $no ."|". $ocicount ." | ".date("G:i:s")." | ". $oci[$i] . ' => ';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment