Created
September 27, 2010 22:25
-
-
Save hay/599995 to your computer and use it in GitHub Desktop.
Script to do a WHOIS for Dutch .nl domains from the terminal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
$domain = $argv[1]; | |
if (!$domain) die("No domain given \n"); | |
$domain = trim($domain); | |
$domain = str_replace(".nl", "", $domain); | |
$data = file_get_contents("https://www.sidn.nl/index.php?eID=tx_sidnwhois_pi1&domain=$domain®=44&det=0&lang=nl&check=true&adv=1®mode=0"); | |
if (!$data) die("Could not get data \n"); | |
$data = strip_tags($data); | |
$data = str_replace(array(" "), "", $data); | |
$data = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n\n", $data); | |
$data = substr($data, 0, strpos($data, "Auteursrechtvoorbehoud")); | |
echo trim($data) . "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To install simply copy to a file called 'whoisnl', make it executable ('chmod u+x whoisnl') and use it:
whoisnl google.nl