Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. $urlArticles = file_get_contents('https://randomuser.me/api');
  2. $urlArticlesArrays = json_decode($urlArticles, true);
  3. $result = $urlArticlesArrays['results'];
  4. $urlArticlesArray = $result['0'];
  5. function getContent($url)
  6. {
  7. $ch = curl_init();
  8. $options = array(
  9. CURLOPT_URL => $url,
  10. CURLOPT_RETURNTRANSFER => true,
  11. CURLOPT_HEADER => true,
  12. CURLOPT_FOLLOWLOCATION => true,
  13. CURLOPT_USERAGENT => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)',
  14. CURLOPT_ENCODING => "",
  15. CURLOPT_AUTOREFERER => true,
  16. CURLOPT_CONNECTTIMEOUT => 5,
  17. CURLOPT_SSL_VERIFYHOST => false,
  18. CURLOPT_SSL_VERIFYPEER => false,
  19. CURLOPT_TIMEOUT => 5,
  20. CURLOPT_MAXREDIRS => 10,
  21. );
  22. curl_setopt_array( $ch, $options );
  23. $data = curl_exec($ch);
  24. $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  25. curl_close($ch);
  26. return htmlspecialchars($data);
  27. }
  28. $url = "https://www.proxynova.com/proxy-server-list/";
  29. $a = getContent($url);
  30. $b = explode("abbr ", $a);
  31. $frst = 0;
  32. $proxies = array();
  33. foreach ($b as $key => $value) {
  34. if ($frst == 0) {
  35. $frst = 1;
  36. continue;
  37. }
  38. $proxy = explode(""", explode("title="", trim($value))[1])[0];
  39. $port = explode(" ",explode("Port ", trim($value))[1])[0];
  40. if (trim($port) == "") {
  41. continue;
  42. }
  43. $myProxy = $proxy . ":" . $port;
  44. array_push($proxies, $myProxy);
  45. break;
  46. }
  47. $tag = json_encode($proxies);
  48. $tag = str_replace("[","", $tag);
  49. $tag = str_replace("]","", $tag);
  50. $tag = str_replace('"','', $tag);
  51. sm($canale, "$tag");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement