Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $q = "192.0.78.24";
- if ($argv[1])
- $q = $argv[1];
- if (!filter_var($q, FILTER_VALIDATE_IP)) {
- $ip = gethostbyname($q);
- if (!filter_var($ip, FILTER_VALIDATE_IP))
- die("ip required: " . $q);
- $q = $ip;
- }
- $result = file_get_contents('http://domainbigdata.com/' . $q);
- preg_match_all('/(?:<a rel="nofollow".*>)(.*)(?:<\/a>)/', $result, $matches);
- //print_r($matches);
- //echo json_encode($matches[1],JSON_PRETTY_PRINT);
- $list = $matches[1];
- sort($list);
- echo (count($list) . "\n");
- for ($i = 0; $i < count($list); $i++) {
- // print ($list[$i]);
- $x = gethostbynamel($list[$i]);
- if ($x) {
- //print_r($x);
- natsort($x);
- echo ($list[$i] . "\t" . implode(", ", $x) . "\n");
- } else {
- echo ($list[$i] . "\t" . "no results\n");
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement