inwwcom.whois update to common object model
This commit is contained in:
parent
4ced207d01
commit
ed5e972aeb
|
@ -1,6 +1,13 @@
|
|||
2003/02/10 David Saez <david@ols.es>
|
||||
- inwwcom.whois updated to common object model
|
||||
- added inwwcom org handle to gtld.whois
|
||||
- gtld.whois now can get the name of the org registrar
|
||||
- minor fixes to generic2.whois
|
||||
|
||||
2003/02/09 Ross Golder <ross@golder.org>
|
||||
- updated to do a 'whois-servers.net' DNS lookup to determine
|
||||
the tld whois server to query
|
||||
|
||||
David Saez <david@ols.es>
|
||||
- netsol.whois & gtld.whois updated to common object model
|
||||
- fixed some warnings in main.whois
|
||||
|
|
|
@ -8,20 +8,21 @@ $disok=true;
|
|||
|
||||
while (list($key,$val)=each($rawdata))
|
||||
{ if (trim($val)!="")
|
||||
{ reset($items);
|
||||
$ok=0;
|
||||
{
|
||||
if (($val[0]=='%' || $val[0]=='#') && $disok)
|
||||
{ $r['disclaimer'][]=trim(substr($val,1));;
|
||||
{ $r['disclaimer'][]=trim(substr($val,1));
|
||||
$disok=true;
|
||||
continue;
|
||||
}
|
||||
|
||||
$disok=false;
|
||||
reset($items);
|
||||
$ok=0;
|
||||
|
||||
while (list($field, $match)=each($items))
|
||||
{ //if (strstr($val,$match))
|
||||
$pos=strpos($val,$match);
|
||||
if ($pos!==false)
|
||||
{
|
||||
$pos=strpos($val,$match);
|
||||
if ($pos!==false)
|
||||
{ $parts=explode(".",$field);
|
||||
$var="\$r";
|
||||
while (list($fn,$mn)=each($parts))
|
||||
|
@ -29,17 +30,17 @@ while (list($key,$val)=each($rawdata))
|
|||
$var=$var."[]";
|
||||
else $var=$var."[\"".$mn."\"]";
|
||||
|
||||
//$itm=trim(substr($val,strlen($match)));
|
||||
$itm=trim(substr($val,$pos+strlen($match)));
|
||||
$itm=addslashes($itm);
|
||||
if ($itm!="")
|
||||
eval($var."=\"".$itm."\";");
|
||||
|
||||
$ok=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($ok==0 && $val[0]==" ")
|
||||
eval($var."=\"".trim($val)."\";");
|
||||
// buggy
|
||||
//if ($ok==0 && $val[0]==" ")
|
||||
// eval($var."=\"".trim($val)."\";");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
13
gtld.whois
13
gtld.whois
|
@ -57,6 +57,7 @@ class gtld extends Whois {
|
|||
"DOTSTER, INC." => "dotster",
|
||||
"ENOM, INC." => "enom",
|
||||
"MELBOURNE IT, LTD. D/B/A INTERNET NAMES WORLDWIDE" => "inwwcom",
|
||||
"R52-LROR" => "inwwcom",
|
||||
"NETWORK SOLUTIONS, INC." => "netsol",
|
||||
"R63-LROR" => "netsol",
|
||||
"REGISTER.COM, INC." => "registercom",
|
||||
|
@ -68,7 +69,7 @@ class gtld extends Whois {
|
|||
function gTLD ($data, $query) {
|
||||
$this->Query = $query;
|
||||
$this->SUBVERSION = sprintf("%s-%s", $query["handler"], $this->HANDLER_VERSION);
|
||||
$this->result = generic_whois($data["rawdata"] , $this->REG_FIELDS);
|
||||
$this->result = generic_whois($data["rawdata"],$this->REG_FIELDS);
|
||||
|
||||
if($this->HACKS["nsi_referral_loop"] &&
|
||||
($this->result["regyinfo"]["whois"] == $this->HACKS["wrong_netsol_whois"])) {
|
||||
|
@ -79,13 +80,19 @@ class gtld extends Whois {
|
|||
|
||||
if (!isset($this->result["rawdata"]))
|
||||
$this->result["rawdata"] = array();
|
||||
|
||||
|
||||
$this->result["rawdata"] = $this->Lookup($this->Query["string"]);
|
||||
// david@ols.es 16/10/2002 Fixes rawdata
|
||||
$this->result["rawdata"] = $this->result["rawdata"]["rawdata"];
|
||||
@$this->Query["handler"] = $this->REGISTRARS[$this->result["regyinfo"]["registrar"]];
|
||||
|
||||
if(!empty($this->Query["handler"])) {
|
||||
if (!empty($this->Query["handler"])) {
|
||||
if (strstr($this->result["regyinfo"]["registrar"],"-LROR"))
|
||||
{
|
||||
// Get the name of the registrar
|
||||
$key = array_search($this->Query["handler"],$this->REGISTRARS);
|
||||
$this->result["regyinfo"]["registrar"] = $key;
|
||||
}
|
||||
$this->Query["file"] = sprintf("%s.whois", $this->Query["handler"]);
|
||||
$domaindata = $this->result["regrinfo"]["domain"];
|
||||
$regrinfo = $this->Process($this->result["rawdata"]);
|
||||
|
|
|
@ -27,55 +27,38 @@
|
|||
*/
|
||||
|
||||
/* inwwcom.whois 1.0 jeremiah bellomy 2000/04/06 */
|
||||
/* inwwcom.whois 2.0 david@ols.es 2003/02/09 */
|
||||
|
||||
require_once("generic2.whois");
|
||||
|
||||
if(!defined("__INWWCOM_HANDLER__")) define("__INWWCOM_HANDLER__",1);
|
||||
|
||||
class inwwcom extends gtld {
|
||||
|
||||
function inwwcom($data) {
|
||||
$this->result=$this->parse(
|
||||
preg_replace("/\n+/","_",implode("\n",$data))
|
||||
);
|
||||
$this->result=$this->parse($data);
|
||||
}
|
||||
|
||||
function parse($data_str) {
|
||||
$data_str=preg_replace("/\s+/"," ",$data_str);
|
||||
|
||||
preg_match("/Organisation Name\.+\s+?(.+?)_/", $data_str,$refs);
|
||||
$r["organization"]=$refs[1];
|
||||
preg_match_all("/_\s*Organisation Address\.+(\s+?(.+?))?_/", $data_str,$refs);
|
||||
$r["org_address"]=implode("\n",$refs[2]);
|
||||
|
||||
preg_match("/Domain Name\.+\s+?(.+?)_/", $data_str,$refs);
|
||||
$r["domain"]=$refs[1];
|
||||
|
||||
preg_match("/Admin Name\.+\s+?(.+?)_/", $data_str,$refs);
|
||||
$r["admin"]["name"]=$refs[1];
|
||||
preg_match("/Admin Email\.+\s+?(.+?)_/", $data_str,$refs);
|
||||
$r["admin"]["email"]=$refs[1];
|
||||
preg_match("/Admin Phone\.+\s+?(.+?)_/", $data_str,$refs);
|
||||
$r["admin"]["phone"]=$refs[1];
|
||||
|
||||
preg_match("/Tech Name\.+\s+?(.+?)_/", $data_str,$refs);
|
||||
$r["tech"]["name"]=$refs[1];
|
||||
preg_match("/Tech Email\.+\s+?(.+?)_/", $data_str,$refs);
|
||||
$r["tech"]["email"]=$refs[1];
|
||||
preg_match("/Tech Phone\.+\s+?(.+?)_/", $data_str,$refs);
|
||||
$r["tech"]["phone"]=$refs[1];
|
||||
|
||||
preg_match("/Registration Date\.+\s+?(.+?)_/", $data_str,$refs);
|
||||
$r["created"]=$refs[1];
|
||||
preg_match("/Expiry Date\.+\s+?(.+?)_/", $data_str,$refs);
|
||||
$r["expiry"]=$refs[1];
|
||||
|
||||
preg_match_all("/Name Server\.+\s+?(.+?)_/", $data_str,$refs);
|
||||
//$r["ns"]=$refs[1];
|
||||
for($i=0,$max=count($refs[1]);$i<$max;$i++) {
|
||||
$k=$refs[1][$i];
|
||||
$r["ns"][$k]=gethostbyname($k);
|
||||
}
|
||||
|
||||
return($r);
|
||||
$items = array ( "domain.name" => "Domain Name..........",
|
||||
"domain.created" => "Registration Date....",
|
||||
"domain.expires" => "Expiry Date..........",
|
||||
"owner.name" => "Organisation Name....",
|
||||
"owner.address." => "Organisation Address.",
|
||||
"admin.name" => "Admin Name...........",
|
||||
"admin.address." => "Admin Address........",
|
||||
"admin.email" => "Admin Email..........",
|
||||
"admin.phone" => "Admin Phone..........",
|
||||
"admin.fax" => "Admin Fax............",
|
||||
"tech.name" => "Tech Name............",
|
||||
"tech.address." => "Tech Address.........",
|
||||
"tech.email" => "Tech Email...........",
|
||||
"tech.phone" => "Tech Phone...........",
|
||||
"tech.fax" => "Tech Fax.............",
|
||||
"domain.nserver." => "Name Server.........."
|
||||
);
|
||||
|
||||
return generic_whois($data_str,$items);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue