rewritten to use generic3.whois
This commit is contained in:
parent
73f79bd2e8
commit
fdbb329f02
1 changed files with 21 additions and 35 deletions
56
nlnic.whois
56
nlnic.whois
|
@ -25,11 +25,14 @@ along with this program; if not, write to the Free Software
|
|||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* nlnic.whois 1.2 David Saez - updated to use generic3.whois */
|
||||
/* nlnic.whois 1.1 David Saez - common object model */
|
||||
/* nlnic.whois 1.0 Matthijs Koot - 2003/01/14 - <koot@cyberwar.nl> */
|
||||
|
||||
if(!defined("__NLNIC_HANDLER__")) define("__NLNIC_HANDLER__",1);
|
||||
|
||||
require_once("generic3.whois");
|
||||
|
||||
class nlnic extends Whois {
|
||||
|
||||
function nlnic($data)
|
||||
|
@ -39,49 +42,32 @@ $this->result=$this->parse($data);
|
|||
|
||||
function parse ($data)
|
||||
{
|
||||
$data_str=preg_replace("/\n+/","_",implode("\n",$data["rawdata"]));
|
||||
$data_str=preg_replace("/\s+/"," ",$data_str);
|
||||
|
||||
$items = array(
|
||||
"domain.name" => "Domain name:",
|
||||
"domain.status" => "Status:",
|
||||
"domain.nserver" => "Domain nameservers:",
|
||||
"domain.created" => "Date first registered:",
|
||||
"domain.changed" => "Record last updated:",
|
||||
"domain.sponsor" => "Record maintained by:",
|
||||
"owner" => "Registrant:",
|
||||
"admin" => "Administrative contact:",
|
||||
"tech" => "Technical contact:"
|
||||
);
|
||||
|
||||
$r["rawdata"]=$data["rawdata"];
|
||||
|
||||
$r["regyinfo"]["whois"]="whois.domain-registry.nl";
|
||||
$r["regyinfo"]["referrer"]="www.domain-registry.nl";
|
||||
$r["regyinfo"]["registrar"]="Stichting Internet Domeinregistratie NL";
|
||||
|
||||
preg_match("/Registrar:_(.+?)_(.+?)/",$data_str, $refs);
|
||||
$r["regyinfo"]["registrar"]=trim($refs[1]);
|
||||
$r["regrinfo"] = get_blocks($data["rawdata"],$items);
|
||||
|
||||
preg_match("/Organisation:_(.+?)_\s/", $data_str,$refs);
|
||||
$r["regrinfo"]["owner"]["organization"]=trim($refs[1]);
|
||||
$r["regrinfo"]["domain"]["name"]=$r["regrinfo"]["domain"]["name"][0];
|
||||
|
||||
preg_match("/Organisation:_(.+?)_(.+?)_\sAdministrative Contact/", $data_str,$refs);
|
||||
$r["regrinfo"]["owner"]["address"]=preg_replace("/_/","\n",trim($refs[2]));
|
||||
$r["regrinfo"]["tech"] = get_contact($r["regrinfo"]["tech"]);
|
||||
$r["regrinfo"]["owner"] = get_contact($r["regrinfo"]["owner"]);
|
||||
$r["regrinfo"]["admin"] = get_contact($r["regrinfo"]["admin"]);
|
||||
|
||||
preg_match("/Domain name:_(.+?)\((.+?)\)_ Organisation/",$data_str,$refs);
|
||||
$r["regrinfo"]["domain"]["name"]=trim($refs[1]);
|
||||
|
||||
preg_match("/Administrative Contact.?_\s(.+?@.+?)_/",$data_str, $refs);
|
||||
preg_match("/(.+?)_\sPhone:\s(.+?)_\sE-mail:\s(.*@.*)/",$refs[1], $refssub);
|
||||
$r["regrinfo"]["admin"]["name"]=$refssub[1];
|
||||
$r["regrinfo"]["admin"]["phone"]=$refssub[2];
|
||||
$r["regrinfo"]["admin"]["email"]=$refssub[3];
|
||||
|
||||
preg_match("/Technical Contact.?_\s(.+?@.+?)_/",$data_str, $refs);
|
||||
preg_match("/(.+?)_\sPhone:\s(.+?)_\sE-mail:\s(.*@.*)/",$refs[1], $refssub);
|
||||
$r["regrinfo"]["tech"]["name"]=$refssub[1];
|
||||
$r["regrinfo"]["tech"]["phone"]=$refssub[2];
|
||||
$r["regrinfo"]["tech"]["email"]=$refssub[3];
|
||||
|
||||
preg_match("/Record last updated:\s(.+?)_/",$data_str, $refs);
|
||||
$r["regrinfo"]["domain"]["changed"]=trim($refs[1]);
|
||||
|
||||
preg_match("/Domain first registered:\s(.+?)_/",$data_str, $refs);
|
||||
$r["regrinfo"]["domain"]["created"]=trim($refs[1]);
|
||||
|
||||
preg_match("/Domain Nameservers:_ (.+?)_\s(.+?)_/",$data_str, $refs);
|
||||
$ns=explode(" ", $refs[1]." ".$refs[2]);
|
||||
$r["regrinfo"]["domain"]["nserver"][$ns[0]]=$ns[1];
|
||||
$r["regrinfo"]["domain"]["nserver"][$ns[2]]=$ns[3];
|
||||
|
||||
return($r);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue