Skip to content

Instantly share code, notes, and snippets.

@hay
Created September 27, 2010 22:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hay/599995 to your computer and use it in GitHub Desktop.
Save hay/599995 to your computer and use it in GitHub Desktop.
Script to do a WHOIS for Dutch .nl domains from the terminal
#!/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&reg=44&det=0&lang=nl&check=true&adv=1&regmode=0");
if (!$data) die("Could not get data \n");
$data = strip_tags($data);
$data = str_replace(array("&nbsp;"), "", $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";
@hay
Copy link
Author

hay commented Sep 27, 2010

To install simply copy to a file called 'whoisnl', make it executable ('chmod u+x whoisnl') and use it:

whoisnl google.nl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment