Reverted last patch (inadvertant)

This commit is contained in:
rossigee 2003-01-19 04:43:39 +00:00
parent 1f8941808d
commit d6605d8238

View file

@ -1,116 +1,84 @@
<?php
/*
Whois2.php PHP classes to conduct whois queries
Copyright (C)1999,2000 easyDNS Technologies Inc. & Mark Jeftovic
Maintained by Mark Jeftovic <markjr@easydns.com>
For the most recent version of this package:
http://www.easydns.com/~markjr/whois2/
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Whois2.php PHP classes to conduct whois queries
Copyright (C)1999,2000 easyDNS Technologies Inc. & Mark Jeftovic
Maintained by Mark Jeftovic <markjr@easydns.com>
For the most recent version of this package:
http://www.easydns.com/~markjr/whois2/
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* bulkregistercom.whois 1.1 Matthijs Koot 2003/01/16 */
/* bulkregistercom.whois 1.0 mark jeftovic 1999/12/06 */
if(!defined("__BULKREGISTERCOM_HANDLER__")) define("__BULKREGISTERCOM_HANDLER__",1);
/*#################################################
Matthijs Koot - 2003/01/14 - <koot@cyberwar.nl>
--> BulkRegister V1.1 UPDATE NOTE:
BulkRegister.com has several antispam measures, which include
grammatic algorithms for changing their Whois output every
x request or every x seconds or so. This update includes
new regexp's to extract the information.
In addition, whois.bulkregister.com will only allow few
whois request to be made from the same IP-address within
a specific period of time. Exceeding requests will be
bounced!
I have tested it on dozens of domains, but as I'm a
regexp newbie it *might* be buggy - bugreports are welcome!
#################################################*/
class bulkregistercom extends gtld {
function bulkregistercom($data) {
$this->result=$this->parse(
preg_replace("/\n+/","_",implode("\n",$data))
);
}
function bulkregistercom($data) {
$this->result=$this->parse(
preg_replace("/\n+/","_",implode("\n",$data))
);
}
function parse ($data_str) {
$data_str=preg_replace("/\s+/"," ",$data_str);
function parse ($data_str) {
$data_str=preg_replace("/\s+/"," ",$data_str);
preg_match("/terms\._(.+?)_(.+?)/", $data_str,$refs);
$r["organization"]=trim($refs[1]);
preg_match("/^(.+)\s+\((.+-DOM)\)_/", $data_str,$refs);
$r["organization"]=$refs[1];
$r["org_handle"]=$refs[2];
preg_match("/terms\._(.+?)_(.*)_\sDomain Name/", $data_str,$refs);
$r["org_address"]=preg_replace("/_/","\n",trim($refs[2]));
preg_match("/\(.+-DOM\)_\s*(.+)_\s*Domain Name:\s(.+)_\sAdmin/",$data_str,$refs);
$r["org_address"]=preg_replace("/_/","\n",$refs[1]);
$r["domain"]=$refs[2];
preg_match("/terms\._.*_\s*Domain Name:\s(.+)_\sAdmin/",$data_str,$refs);
$r["domain"]=trim($refs[1]);
preg_match("/Administrative .*?Contact:_(.+?)\((.+?)\)\s(.+?@.+?)_/",$data_str, $refs);
$r["admin"]["name"]=$refs[1];
$r["admin"]["handle"]=$refs[2];
$r["admin"]["email"]=$refs[3];
preg_match("/Administrative Contact(.+?)\s(.+?@.+?)_/",$data_str, $refs);
preg_match("/_?(.*)[:->]*?\s(.*@.*)/",$refs[2], $refssub);
while (preg_match("/[:\->]+?/", substr($refssub[1],-1))>0)
{$refssub[1]=substr($refssub[1], 0, strlen($refssub[1]) -1);}
$r["admin"]["name"]=$refssub[1];
$r["admin"]["email"]=$refssub[2];
$r["admin"]["handle"]="";
preg_match("/Technical Contact(.+?)\s(.+?@.+?)_/",$data_str, $refs);
preg_match("/_?(.*)[:->]*?\s(.*@.*)/",$refs[2], $refssub);
while (preg_match("/[:\->]+?/", substr($refssub[1],-1))>0)
{$refssub[1]=substr($refssub[1], 0, strlen($refssub[1]) -1);}
$r["tech"]["name"]=$refssub[1];
$r["tech"]["email"]=$refssub[2];
$r["tech"]["handle"]="";
preg_match("/Billing Contact(.+?)\s(.+?@.+?)_/",$data_str, $refs);
preg_match("/_?(.*)[:->]*?\s(.*@.*)/",$refs[2], $refssub);
while (preg_match("/[:\->]+?/", substr($refssub[1],-1))>0)
{$refssub[1]=substr($refssub[1], 0, strlen($refssub[1]) -1);}
$r["billing"]["name"]=$refssub[1];
$r["billing"]["email"]=$refssub[2];
$r["billing"]["handle"]="";
preg_match("/Technical .*?Contact:_(.+?)\((.+?)\)\s(.+?@.+?)_/",$data_str, $refs);
$r["tech"]["name"]=$refs[1];
$r["tech"]["handle"]=$refs[2];
$r["tech"]["email"]=$refs[3];
preg_match("/Record (update|updated) (date|on)( on)?( | -|: |->)?(.+?)_/",$data_str, $refs);
$r["updated"]=trim($refs[5]);
preg_match("/Billing Contact:_(.+?)\((.+?)\)\s(.+?@.+?)_/",$data_str, $refs);
$r["billing"]["name"]=$refs[1];
$r["billing"]["handle"]=$refs[2];
$r["billing"]["email"]=$refs[3];
preg_match("/Record (create|created) (date|on)( on)?( | -|: |->)?(.+?)_/",$data_str, $refs);
$r["created"]=trim($refs[5]);
preg_match("/Record (will|expire|expires|expiring)( on| date| be| expire)( expiring on date| on| date)?( |: | -|->)?(.+?)_/",$data_str, $refs);
$r["expires"]=trim($refs[5]);
preg_match("/(Database last updated on|Database last updated on:) (.+?)\./",$data_str, $refs);
$r["db_updated"]=$refs[1];
preg_match("/Domain servers in listed order:_ (.+)_Register/",$data_str, $refs);
$ns=explode("_", $refs[1]);
for($i=0,$max=count($ns);$i<$max;$i++) {
list($k,$v)=split(" ", trim($ns[$i]));
$r["ns"][$k]=$v;
}
return($r);
}
preg_match("/Record updated on (.+?)\./",$data_str, $refs);
$r["updated"]=$refs[1];
preg_match("/Record created on (.+?)\./",$data_str, $refs);
$r["created"]=$refs[1];
preg_match("/Database last updated on (.+?)\./",$data_str, $refs);
$r["db_updated"]=$refs[1];
preg_match("/Domain servers in listed order:_ (.+)$/",$data_str, $refs);
$ns=explode("_", $refs[1]);
for($i=0,$max=count($ns);$i<$max;$i++) {
list($k,$v)=split(" ", trim($ns[$i]));
$r["ns"][$k]=$v;
}
return($r);
}
}
?>