Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $start1 = microtime(true);
- error_reporting(0);
- $servername = "localhost";
- $username = "proxies";
- $password = "seF83UFsbqtMujXr";
- $dbname = "proxies";
- $conn = new mysqli($servername, $username, $password, $dbname);
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $string = file_get_contents('unsorted.txt');
- preg_match_all('/[a-z]+:\/\/\S+/', $string, $matches);
- foreach(array_unique($matches[0]) as $i => $url)
- {
- $url = parse_url($url)['host'];
- $start = microtime(true);
- $contents = file_get_contents("https://"."$url");
- $search = <<<EOF
- <meta name="google-site-verification" content="bERYeomIC5eBWlPLupPPYPYGA9GvAUKzFHh3WIw24Xs" />
- EOF;
- if (strpos($contents, $search) === FALSE) {
- $end = microtime(true);
- $time = $end - $start;
- } else {
- $end = microtime(true);
- $time = $end - $start;
- if ($url == "thepiratebay.se") {
- echo "$url Disallowed!\n";
- }else{
- if ($time > "5") {
- echo "$url Took Too Long To Load!\n";
- }else{
- $md5 = md5("$contents");
- $checktime = time();
- $ip = gethostbyname("$url");
- $details = json_decode(file_get_contents("http://ip-api.com/json/{$ip}"));
- $sql = "INSERT INTO proxies (URL, TIME, IP, COUNTRY, MD5, CHECKTIME)
- VALUES ('$url', '$time', '$ip', '$details->country', '$md5', '$checktime')";
- if ($conn->query($sql) === TRUE) {
- echo "$url Added!\n";
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- }
- }
- }
- }
- $conn->close();
- $end1 = microtime(true);
- $time1 = $end1 - $start1;
- echo "All Done! Seraching Compleated In $time1";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement