fixed and updated to common object model

This commit is contained in:
sparc 2003-02-16 22:03:08 +00:00
parent 25fde61aa5
commit 40a9f3e695

View file

@ -28,71 +28,45 @@
/* enom.whois 1.0 stephen leavitt 2000/12/09 */
/* enom.whois 2.0 tim schulte 2001/03/21 */
/* enom.whois 3.0 david@ols.es 2003/02/16 */
if(!defined("__ENOM_HANDLER__")) define("__ENOM_HANDLER__",1);
require_once("generic3.whois");
class enom extends gtld {
function enom($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("/^(.+?)_ _/",$data_str,$refs);
$r["disclaimer"] = preg_replace("/_/","\n",$refs[1]);
preg_match("/Domain name:\s(.+) _ _Registrant/", $data_str,$refs);
$r["domain"] = $refs[1];
preg_match( "/Registrant: _\s(.+?) _\s(.+?) \((.+?@.+?)\) _\s(.+?) _\s(.+?) _\s(.+?) _\s(.+?) _\s(.+?) _\s(.+?)/",$data_str, $refs);
$r["registrant"]["companyname"] = $refs[1];
$r["registrant"]["name"] = $refs[2];
$r["registrant"]["email"] = $refs[3];
$r["registrant"]["phone"] = $refs[4];
$r["registrant"]["address1"] = $refs[5];
$r["registrant"]["address2"] = $refs[6];
$r["registrant"]["city"] = $refs[7];
$r["registrant"]["country"] = $refs[8];
preg_match( "/Administrative: _\s(.+?) _\s(.+?) \((.+?@.+?)\) _\s(.+?) _\s(.+?) _\s(.+?) _\s(.+?) _\s(.+?) _\s(.+?)/",$data_str, $refs);
$r["administrative"]["companyname"] = $refs[1];
$r["administrative"]["name"] = $refs[2];
$r["administrative"]["email"] = $refs[3];
$r["administrative"]["phone"] = $refs[4];
$r["administrative"]["address1"] = $refs[6];
$r["administrative"]["city"] = $refs[7];
$r["administrative"]["country"] = $refs[8];
preg_match( "/Billing: _\s(.+?) _\s(.+?) \((.+?@.+?)\) _\s(.+?) _\s(.+?) _\s(.+?) _\s(.+?) _\s(.+?) _\s(.+?)/",$data_str, $refs);
$r["billing"]["companyname"] = $refs[1];
$r["billing"]["name"] = $refs[2];
$r["billing"]["email"] = $refs[3];
$r["billing"]["phone"] = $refs[4];
$r["billing"]["address1"] = $refs[6];
$r["billing"]["city"] = $refs[7];
$r["billing"]["country"] = $refs[8];
preg_match( "/Technical: _\s(.+?) _\s(.+?) \((.+?@.+?)\) _\s(.+?) _\s(.+?) _\s(.+?) _\s(.+?) _\s(.+?) _\s(.+?)/",$data_str, $refs);
$r["technical"]["companyname"] = $refs[1];
$r["technical"]["name"] = $refs[2];
$r["technical"]["email"] = $refs[3];
$r["technical"]["phone"] = $refs[4];
$r["technical"]["address1"] = $refs[6];
$r["technical"]["city"] = $refs[7];
$r["technical"]["country"] = $refs[8];
preg_match("/DOMAIN EXPIRES : (.+?)\ /",$data_str, $refs);
$r["expires"] = $refs[1];
return($r);
$items = array( "owner" => "Registrant Contact",
"admin" => "Administrative Contact",
"tech" => "Technical Contact",
"billing" => "Billing Contact",
"domain.nserver" => "Nameservers",
"domain.name#0" => "Domain name:",
"domain.name#1" => "Domain name-",
"domain.status" => "Status:",
"domain.created#0" => "Creation date:",
"domain.expires#0" => "Expiration date:",
"domain.created#1" => "Created:",
"domain.expires#1" => "Expires:",
"domain.created#2" => "Start of registration-",
"domain.expires#2" => "Registered through-",
);
$r = get_blocks($data_str,$items);
$r["owner"] = get_contact($r["owner"]);
$r["admin"] = get_contact($r["admin"]);
$r["tech"] = get_contact($r["tech"]);
$r["billing"] = get_contact($r["billing"]);
return($r);
}
}
?>