Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $urlArticles = file_get_contents('https://randomuser.me/api');
- $urlArticlesArrays = json_decode($urlArticles, true);
- $result = $urlArticlesArrays['results'];
- $urlArticlesArray = $result['0'];
- function getContent($url)
- {
- $ch = curl_init();
- $options = array(
- CURLOPT_URL => $url,
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_HEADER => true,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_USERAGENT => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
- CURLOPT_ENCODING => "",
- CURLOPT_AUTOREFERER => true,
- CURLOPT_CONNECTTIMEOUT => 5,
- CURLOPT_SSL_VERIFYHOST => false,
- CURLOPT_SSL_VERIFYPEER => false,
- CURLOPT_TIMEOUT => 5,
- CURLOPT_MAXREDIRS => 10,
- );
- curl_setopt_array( $ch, $options );
- $data = curl_exec($ch);
- $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
- curl_close($ch);
- return htmlspecialchars($data);
- }
- $url = "https://www.proxynova.com/proxy-server-list/";
- $a = getContent($url);
- $b = explode("abbr ", $a);
- $frst = 0;
- $proxies = array();
- foreach ($b as $key => $value) {
- if ($frst == 0) {
- $frst = 1;
- continue;
- }
- $proxy = explode(""", explode("title="", trim($value))[1])[0];
- $port = explode(" ",explode("Port ", trim($value))[1])[0];
- if (trim($port) == "") {
- continue;
- }
- $myProxy = $proxy . ":" . $port;
- array_push($proxies, $myProxy);
- break;
- }
- $tag = json_encode($proxies);
- $tag = str_replace("[","", $tag);
- $tag = str_replace("]","", $tag);
- $tag = str_replace('"','', $tag);
- sm($canale, "$tag");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement