several handler fixes

This commit is contained in:
sparc 2008-05-17 17:49:17 +00:00
parent e583589894
commit f3846553e8
17 changed files with 350 additions and 350 deletions

View file

@ -1,3 +1,21 @@
2008/05/11
- fixed whois.museum
2008/05/09
- do not use handlers on error
2008/05/04
- improved nameserver detection (again)
- fixed whois.pl, whois.gtld.nominalia,
whois.gtld.onlinenic, whois.ovh
- removed test for informe.ws
- minor fix to whois.gtld.enom
- minor chages to other handlers
2008/04/29
- improved nameserver detection (again)
- fixes & improvements on whois.mx
2008/04/28
- whois.za.php renamed to whois.zanet.php
- added support & handler for .org.za
@ -5,6 +23,7 @@
- minor improvemts on whois.client.php to allow
handlers for second level domains
- improved nameserver detection
- minor fix to .ie handler
2008/03/05
- dotregistrar is now part of dotster

View file

@ -37,57 +37,57 @@ class aero_handler
{
$items = array(
"Domain ID:" => "domain.handle",
"Domain Name:" => "domain.name",
"Creation Date:" => "domain.created",
'Domain ID:' => 'domain.handle',
'Domain Name:' => 'domain.name',
'Creation Date:' => 'domain.created',
'Last Modification Date:' => 'domain.changed',
"Expiration Date:" => "domain.expires",
"Sponsoring Registrar:" => "domain.sponsor",
"Name Server:" => "domain.nserver.",
"Registrant ID:" => "owner.handle",
"Registrant Name:" => "owner.name",
"Registrant Organization:" => "owner.organization",
"Registrant Address:" => "owner.address.street",
"Registrant City:" => "owner.address.city",
'Expiration Date:' => 'domain.expires',
'Sponsoring Registrar:' => 'domain.sponsor',
'Name Server:' => 'domain.nserver.',
'Registrant ID:' => 'owner.handle',
'Registrant Name:' => 'owner.name',
'Registrant Organization:' => 'owner.organization',
'Registrant Address:' => 'owner.address.street',
'Registrant City:' => 'owner.address.city',
'Registrant State/Province:' => 'owner.address.state',
"Registrant Postal Code:" => "owner.address.pcode",
"Registrant Country:" => "owner.address.country",
"Registrant Phone Number:" => "owner.phone",
"Registrant Fax Number:" => "owner.fax",
"Registrant Email:" => "owner.email",
"Admin ID:" => "admin.handle",
"Admin Name:" => "admin.name",
"Admin Organization:" => "admin.organization",
"Admin Address:" => "admin.address.street",
"Admin City:" => "admin.address.city",
"Admin State/Province:" => "admin.address.state",
"Admin Postal Code:" => "admin.address.pcode",
"Admin Country:" => "admin.address.country",
"Admin Phone Number:" => "admin.phone",
"Admin Fax Number:" => "admin.fax",
"Admin Email:" => "admin.email",
"Tech ID:" => "tech.handle",
"Tech Name:" => "tech.name",
"Tech Organization:" => "tech.organization",
"Tech Address:" => "tech.address.street.",
"Tech City:" => "tech.address.city",
"Tech Postal Code:" => "tech.address.pcode",
"Tech State/Province:" => "tech.address.state",
"Tech Country:" => "tech.address.country",
"Tech Phone Number:" => "tech.phone",
"Tech Fax Number:" => "tech.fax",
"Tech Email:" => "tech.email",
"Billing ID:" => "billing.handle",
"Billing Name:" => "billing.name",
"Billing Organization:" => "billing.organization",
"Billing Address:" => "billing.address.street",
"Billing City:" => "billing.address.city",
"Billing Postal Code:" => "billing.address.pcode",
"Billing State/Province:" => "billing.address.state",
"Billing Country:" => "billing.address.country",
"Billing Phone Number:" => "billing.phone",
"Billing Fax Number:" => "billing.fax",
"Billing Email:" => "billing.email"
'Registrant Postal Code:' => 'owner.address.pcode',
'Registrant Country:' => 'owner.address.country',
'Registrant Phone Number:' => 'owner.phone',
'Registrant Fax Number:' => 'owner.fax',
'Registrant Email:' => 'owner.email',
'Admin ID:' => 'admin.handle',
'Admin Name:' => 'admin.name',
'Admin Organization:' => 'admin.organization',
'Admin Address:' => 'admin.address.street',
'Admin City:' => 'admin.address.city',
'Admin State/Province:' => 'admin.address.state',
'Admin Postal Code:' => 'admin.address.pcode',
'Admin Country:' => 'admin.address.country',
'Admin Phone Number:' => 'admin.phone',
'Admin Fax Number:' => 'admin.fax',
'Admin Email:' => 'admin.email',
'Tech ID:' => 'tech.handle',
'Tech Name:' => 'tech.name',
'Tech Organization:' => 'tech.organization',
'Tech Address:' => 'tech.address.street.',
'Tech City:' => 'tech.address.city',
'Tech Postal Code:' => 'tech.address.pcode',
'Tech State/Province:' => 'tech.address.state',
'Tech Country:' => 'tech.address.country',
'Tech Phone Number:' => 'tech.phone',
'Tech Fax Number:' => 'tech.fax',
'Tech Email:' => 'tech.email',
'Billing ID:' => 'billing.handle',
'Billing Name:' => 'billing.name',
'Billing Organization:' => 'billing.organization',
'Billing Address:' => 'billing.address.street',
'Billing City:' => 'billing.address.city',
'Billing Postal Code:' => 'billing.address.pcode',
'Billing State/Province:' => 'billing.address.state',
'Billing Country:' => 'billing.address.country',
'Billing Phone Number:' => 'billing.phone',
'Billing Fax Number:' => 'billing.fax',
'Billing Email:' => 'billing.email'
);
$r['regyinfo'] = array(

View file

@ -216,7 +216,10 @@ class WhoisClient {
$result = array( 'rawdata' => $output );
$result = $this->set_whois_info($result);
// If we have a handler, post-process it with that
// Return now on error
if (empty($output)) return $result;
// If we have a handler, post-process it with it
if (isSet($this->Query['handler']))
{
// Keep server list
@ -475,7 +478,7 @@ class WhoisClient {
{
$parts = explode('.',$wserver);
$hname = strtolower($parts[1]);
if (($fp = @fopen('whois.gtld.'.$hname.'.php', 'r', 1)) and fclose($fp))
$this->Query['handler'] = $hname;
}

View file

@ -62,7 +62,7 @@ class enom_handler
'domain.expires#2' => 'Registered through-'
);
$r = get_blocks($data_str, $items);
$r = get_blocks($data_str, $items, true);
if (isset($r['owner']))
$r['owner'] = get_contact($r['owner'],false,true);

View file

@ -28,8 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* interdomain.whois 2.0 David Saez Padros <david@ols.es> */
/* interdomain.whois 1.1 David Saez Padros <david@ols.es> */
if (!defined("__INTERDOMAIN_HANDLER__"))
define("__INTERDOMAIN_HANDLER__", 1);
if (!defined('__INTERDOMAIN_HANDLER__'))
define('__INTERDOMAIN_HANDLER__', 1);
require_once('whois.parser.php');
@ -40,47 +40,46 @@ class interdomain_handler
{
$items = array(
"Domain Name................" => "domain.name",
"Creation Date............" => "domain.created",
"Expiry Date.............." => "domain.expires",
"Last Update Date........." => "domain.changed",
"Name Server............." => "domain.nserver.",
"Organization Name........" => "owner.name",
"Organization Org........." => "owner.organization",
"Organization Street......" => "owner.address.street",
"Organization City........" => "owner.address.city",
"Organization State......." => "owner.address.state",
"Organization PC.........." => "owner.address.pcode",
"Organization Country....." => "owner.address.country",
"Organization Phone......." => "owner.phone",
"Organization e-mail......" => "owner.email",
"Organization Contact Id...." => "owner.handle",
"Administrative Contact Id.." => "admin.handle",
"Administrative Name......" => "admin.name",
"Administrative Org......." => "admin.organization",
"Administrative Street...." => "admin.address.street",
"Administrative City......" => "admin.address.city",
"Administrative State....." => "admin.address.state",
"Administrative PC........" => "admin.address.pcode",
"Administrative Country..." => "admin.address.country",
"Administrative Phone....." => "admin.phone",
"Administrative e-mail...." => "admin.email",
"Administrative Fax......." => "admin.fax",
"Technical Contact Id......." => "tech.handle",
"Technical Name..........." => "tech.name",
"Technical Org............" => "tech.organization",
"Technical Street........." => "tech.address.street",
"Technical City..........." => "tech.address.city",
"Technical State.........." => "tech.address.state",
"Technical PC............." => "tech.address.pcode",
"Technical Country........" => "tech.address.country",
"Technical Phone.........." => "tech.phone",
"Technical e-mail........." => "tech.email",
"Technical Fax............" => "tech.fax"
'Domain Name................' => 'domain.name',
'Creation Date............' => 'domain.created',
'Expiry Date..............' => 'domain.expires',
'Last Update Date.........' => 'domain.changed',
'Name Server.............' => 'domain.nserver.',
'Organization Name........' => 'owner.name',
'Organization Org.........' => 'owner.organization',
'Organization Street......' => 'owner.address.street',
'Organization City........' => 'owner.address.city',
'Organization State.......' => 'owner.address.state',
'Organization PC..........' => 'owner.address.pcode',
'Organization Country.....' => 'owner.address.country',
'Organization Phone.......' => 'owner.phone',
'Organization e-mail......' => 'owner.email',
'Organization Contact Id....' => 'owner.handle',
'Administrative Contact Id..' => 'admin.handle',
'Administrative Name......' => 'admin.name',
'Administrative Org.......' => 'admin.organization',
'Administrative Street....' => 'admin.address.street',
'Administrative City......' => 'admin.address.city',
'Administrative State.....' => 'admin.address.state',
'Administrative PC........' => 'admin.address.pcode',
'Administrative Country...' => 'admin.address.country',
'Administrative Phone.....' => 'admin.phone',
'Administrative e-mail....' => 'admin.email',
'Administrative Fax.......' => 'admin.fax',
'Technical Contact Id.......' => 'tech.handle',
'Technical Name...........' => 'tech.name',
'Technical Org............' => 'tech.organization',
'Technical Street.........' => 'tech.address.street',
'Technical City...........' => 'tech.address.city',
'Technical State..........' => 'tech.address.state',
'Technical PC.............' => 'tech.address.pcode',
'Technical Country........' => 'tech.address.country',
'Technical Phone..........' => 'tech.phone',
'Technical e-mail.........' => 'tech.email',
'Technical Fax............' => 'tech.fax'
);
$ret = generic_parser_b($data_str, $items, 'dmy');
return $ret;
return generic_parser_b($data_str, $items, 'dmy');
}
}

View file

@ -70,7 +70,7 @@ class onlinenic_handler
$r = get_blocks($data_str, $items, true);
if (isset($r['owner']))
$r['owner'] = get_contact($r['owner'],$extra);
$r['owner'] = get_contact($r['owner'],$extra);
if (isset($r['admin']))
$r['admin'] = get_contact($r['admin'],$extra);
if (isset($r['tech']))
@ -78,7 +78,16 @@ class onlinenic_handler
if (isset($r['bill']))
$r['bill'] = get_contact($r['bill'],$extra);
format_dates($r['domain'], 'mdy');
foreach($r as $key => $part)
if (isset($part['email']))
{
@list($email,$phone) = explode(' ',$part['email']);
$email = str_replace('(','',$email);
$email = str_replace(')','',$email);
$r[$key]['email'] = $email;
if ($phone != '') $r[$key]['phone'] = $phone;
}
format_dates($r['domain'], 'mdy');
return ($r);
}

View file

@ -35,29 +35,25 @@ class ovh_handler
function parse($data_str, $query)
{
$translate = array(
'nic-hdl' => 'handle',
'person' => 'name',
'adresse' => 'address'
$items = array(
'owner' => 'Registrant:',
'admin' => 'Administrative Contact:',
'tech' => 'Technical Contact:',
'billing' => 'Billing Contact:',
'domain.sponsor' => 'Registrar of Record:',
'domain.changed' => 'Record last updated on',
'domain.expires' => 'Record expires on',
'domain.created' => 'Record created on'
);
$contacts = array(
'tech-c' => 'tech',
'admin-c' => 'admin',
'bill-c' => 'billing'
);
$r = generic_parser_a($data_str, $translate, $contacts, 'owner', 'ymd');
if (isset($r['owner']['domain']))
{
unset($r['owner']['domain']);
unset($r['owner']['nserver']);
unset($r['owner']['created']);
unset($r['owner']['expires']);
unset($r['owner']['changed']);
}
$r = get_blocks($data_str, $items, true);
$r['owner'] = get_contact($r['owner']);
$r['admin'] = get_contact($r['admin']);
$r['tech'] = get_contact($r['tech']);
$r['billing'] = get_contact($r['billing']);
format_dates($r, 'mdy');
return ($r);
}
}

View file

@ -27,8 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* schlund.whois 1.00 David Saez <david@ols.es> */
if (!defined("__SCHLUND_HANDLER__"))
define("__SCHLUND_HANDLER__", 1);
if (!defined('__SCHLUND_HANDLER__'))
define('__SCHLUND_HANDLER__', 1);
require_once('whois.parser.php');
@ -39,49 +39,49 @@ class schlund_handler
{
$items = array(
"created:" => "domain.created",
"last-changed:" => "domain.changed",
"status:" => "domain.status",
"registrant-firstname:" => "owner.name.first",
"registrant-lastname:" => "owner.name.last",
"registrant-organization:" => "owner.organization",
"registrant-street1:" => "owner.address.street.",
"registrant-street2:" => "owner.address.street.",
"registrant-pcode:" => "owner.address.pcode",
"registrant-city:" => "owner.address.city",
"registrant-ccode:" => "owner.address.country",
"registrant-phone:" => "owner.phone",
"registrant-email:" => "onwer.email",
"admin-c-firstname:" => "admin.name.first",
"admin-c-lastname:" => "admin.name.last",
"admin-c-organization:" => "admin.organization",
"admin-c-street1:" => "admin.address.street.",
"admin-c-street2:" => "admin.address.street.",
"admin-c-pcode:" => "admin.address.pcode",
"admin-c-city:" => "admin.address.city",
"admin-c-ccode:" => "admin.address.country",
"admin-c-phone:" => "admin.phone",
"admin-c-email:" => "admin.email",
"tech-c-firstname:" => "tech.name.first",
"tech-c-lastname:" => "tech.name.last",
"tech-c-organization:" => "tech.organization",
"tech-c-street1:" => "tech.address.street.",
"tech-c-street2:" => "tech.address.street.",
"tech-c-pcode:" => "tech.address.pcode",
"tech-c-city:" => "tech.address.city",
"tech-c-ccode:" => "tech.address.country",
"tech-c-phone:" => "tech.phone",
"tech-c-email:" => "tech.email",
"bill-c-firstname:" => "billing.name.first",
"bill-c-lastname:" => "billing.name.last",
"bill-c-organization:" => "billing.organization",
"bill-c-street1:" => "billing.address.street.",
"bill-c-street2:" => "billing.address.street.",
"bill-c-pcode:" => "billing.address.pcode",
"bill-c-city:" => "billing.address.city",
"bill-c-ccode:" => "billing.address.country",
"bill-c-phone:" => "billing.phone",
"bill-c-email:" => "billing.email"
'created:' => 'domain.created',
'last-changed:' => 'domain.changed',
'status:' => 'domain.status',
'registrant-firstname:' => 'owner.name.first',
'registrant-lastname:' => 'owner.name.last',
'registrant-organization:' => 'owner.organization',
'registrant-street1:' => 'owner.address.street.',
'registrant-street2:' => 'owner.address.street.',
'registrant-pcode:' => 'owner.address.pcode',
'registrant-city:' => 'owner.address.city',
'registrant-ccode:' => 'owner.address.country',
'registrant-phone:' => 'owner.phone',
'registrant-email:' => 'onwer.email',
'admin-c-firstname:' => 'admin.name.first',
'admin-c-lastname:' => 'admin.name.last',
'admin-c-organization:' => 'admin.organization',
'admin-c-street1:' => 'admin.address.street.',
'admin-c-street2:' => 'admin.address.street.',
'admin-c-pcode:' => 'admin.address.pcode',
'admin-c-city:' => 'admin.address.city',
'admin-c-ccode:' => 'admin.address.country',
'admin-c-phone:' => 'admin.phone',
'admin-c-email:' => 'admin.email',
'tech-c-firstname:' => 'tech.name.first',
'tech-c-lastname:' => 'tech.name.last',
'tech-c-organization:' => 'tech.organization',
'tech-c-street1:' => 'tech.address.street.',
'tech-c-street2:' => 'tech.address.street.',
'tech-c-pcode:' => 'tech.address.pcode',
'tech-c-city:' => 'tech.address.city',
'tech-c-ccode:' => 'tech.address.country',
'tech-c-phone:' => 'tech.phone',
'tech-c-email:' => 'tech.email',
'bill-c-firstname:' => 'billing.name.first',
'bill-c-lastname:' => 'billing.name.last',
'bill-c-organization:' => 'billing.organization',
'bill-c-street1:' => 'billing.address.street.',
'bill-c-street2:' => 'billing.address.street.',
'bill-c-pcode:' => 'billing.address.pcode',
'bill-c-city:' => 'billing.address.city',
'bill-c-ccode:' => 'billing.address.country',
'bill-c-phone:' => 'billing.phone',
'bill-c-email:' => 'billing.email'
);
$r = generic_parser_b($data_str, $items);

View file

@ -39,6 +39,7 @@ class ie_handler
$translate = array(
'nic-hdl' => 'handle',
'person' => 'name',
'renewal' => 'expires'
);
$contacts = array(

View file

@ -285,8 +285,7 @@ class Whois extends WhoisClient
$result['regrinfo']['registered'] = 'unknown';
}
if (!isset($result['regrinfo']['domain']['nserver']))
return ;
if (!isset($result['regrinfo']['domain']['nserver'])) return;
// Normalize nameserver fields
$nserver = $result['regrinfo']['domain']['nserver'];
@ -299,7 +298,7 @@ class Whois extends WhoisClient
$dns = array();
while (list($key, $val) = each($nserver))
foreach($nserver as $val)
{
$val = str_replace( array('[',']','(',')'), '', trim($val));
$val = str_replace("\t", ' ', $val);
@ -309,10 +308,15 @@ class Whois extends WhoisClient
foreach($parts as $p)
{
if (substr($p,-1) == '.') $p = substr($p,0,-1);
if ((ip2long($p) == - 1) or (ip2long($p) === false))
{
// Hostname ?
if (strpos($p,'.')) $host = $p;
if ($host == '' && preg_match('/^[\w\-]+(\.[\w\-]+)+$/',$p))
{
$host = $p;
}
}
else
// IP Address

View file

@ -37,52 +37,52 @@ class museum_handler
{
$items = array(
"ENS Identity:" => "domain.handle",
"Domain Name:" => "domain.name",
"Created On:" => "domain.created",
"Expires ON:" => "domain.expires",
"Sponsoring Registrar:" => "domain.sponsor",
"Name Server:" => "domain.nserver.",
"Registrant ID:" => "owner.handle",
"Registrant Name:" => "owner.name",
"Registrant Organization:" => "owner.organization",
"Registrant Address:" => "owner.address.street",
"Registrant City:" => "owner.address.city",
"Registrant Postal Code:" => "owner.address.pcode",
"Registrant Country:" => "owner.address.country",
"Registrant Phone Number:" => "owner.phone",
"Registrant Fax Number:" => "owner.fax",
"Registrant Email:" => "owner.email",
"Admin ID:" => "admin.handle",
"Admin Name:" => "admin.name",
"Admin Organization:" => "admin.organization",
"Admin Address:" => "admin.address.street",
"Admin City:" => "admin.address.city",
"Admin Postal Code:" => "admin.address.pcode",
"Admin Country:" => "admin.address.country",
"Admin Phone Number:" => "admin.phone",
"Admin Fax Number:" => "admin.fax",
"Admin Email:" => "admin.email",
"Tech ID:" => "tech.handle",
"Tech Name:" => "tech.name",
"Tech Organization:" => "tech.organization",
"Tech Address:" => "tech.address.street.",
"Tech City:" => "tech.address.city",
"Tech Postal Code:" => "tech.address.pcode",
"Tech Country:" => "tech.address.country",
"Tech Phone Number:" => "tech.phone",
"Tech Fax Number:" => "tech.fax",
"Tech Email:" => "tech.email",
"Billing ID:" => "billing.handle",
"Billing Name:" => "billing.name",
"Billing Organization:" => "billing.organization",
"Billing Address:" => "billing.address.street",
"Billing City:" => "billing.address.city",
"Billing Postal Code:" => "billing.address.pcode",
"Billing Country:" => "billing.address.country",
"Billing Phone Number:" => "billing.phone",
"Billing Fax Number:" => "billing.fax",
"Billing Email:" => "billing.email"
'Domain ID:' => 'domain.handle',
'Domain Name:' => 'domain.name',
'Created On:' => 'domain.created',
'Expiration Date:' => 'domain.expires',
'Registrar ID:' => 'domain.sponsor',
'Name Server:' => 'domain.nserver.',
'Registrant ID:' => 'owner.handle',
'Registrant Name:' => 'owner.name',
'Registrant Organization:'=> 'owner.organization',
'Registrant Street:' => 'owner.address.street',
'Registrant City:' => 'owner.address.city',
'Registrant Postal Code:' => 'owner.address.pcode',
'Registrant Country:' => 'owner.address.country',
'Registrant Phone:' => 'owner.phone',
'Registrant Fax:' => 'owner.fax',
'Registrant Email:' => 'owner.email',
'Admin ID:' => 'admin.handle',
'Admin Name:' => 'admin.name',
'Admin Organization:' => 'admin.organization',
'Admin Street:' => 'admin.address.street',
'Admin City:' => 'admin.address.city',
'Admin Postal Code:' => 'admin.address.pcode',
'Admin Country:' => 'admin.address.country',
'Admin Phone:' => 'admin.phone',
'Admin Fax:' => 'admin.fax',
'Admin Email:' => 'admin.email',
'Tech ID:' => 'tech.handle',
'Tech Name:' => 'tech.name',
'Tech Organization:' => 'tech.organization',
'Tech Street:' => 'tech.address.street.',
'Tech City:' => 'tech.address.city',
'Tech Postal Code:' => 'tech.address.pcode',
'Tech Country:' => 'tech.address.country',
'Tech Phone:' => 'tech.phone',
'Tech Fax:' => 'tech.fax',
'Tech Email:' => 'tech.email',
'Billing ID:' => 'billing.handle',
'Billing Name:' => 'billing.name',
'Billing Organization:' => 'billing.organization',
'Billing Street:' => 'billing.address.street',
'Billing City:' => 'billing.address.city',
'Billing Postal Code:' => 'billing.address.pcode',
'Billing Country:' => 'billing.address.country',
'Billing Phone:' => 'billing.phone',
'Billing Fax:' => 'billing.fax',
'Billing Email:' => 'billing.email'
);
$r['regyinfo'] = array(

View file

@ -28,8 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* mxnic.whois 1.0 Torfinn Nome <torfinn@nome.no> 2003-02-15 */
/* Based upon info.whois by David Saez Padros <david@ols.es> */
if (!defined("__MX_HANDLER__"))
define("__MX_HANDLER__", 1);
if (!defined('__MX_HANDLER__'))
define('__MX_HANDLER__', 1);
require_once('whois.parser.php');
@ -40,77 +40,87 @@ class mx_handler
{
$contacts = array(
"admin" => "ADMINISTRATIVO",
"tech" => "TECNICO",
"billing" => "DE PAGO"
'admin' => 'ADMINISTRATIVO',
'tech' => 'TECNICO',
'billing' => 'DE PAGO'
);
$items = array(
"name" => "DOMINIO:",
"created" => "FECHA DE CREACION:",
"changed" => "FECHA DE ULTIMA MODIFICACION:"
'name' => 'DOMINIO:',
'created' => 'FECHA DE CREACION:',
'changed' => 'FECHA DE ULTIMA MODIFICACION:'
);
$r["regrinfo"] = array();
$r["regrinfo"]["domain"]["nserver"] = array();
$r["regrinfo"]["admin"] = array();
$r["regrinfo"]["tech"] = array();
$r["regrinfo"]["billing"] = array();
$r["regrinfo"]["owner"] = array();
$r['regrinfo'] = array();
$r['regrinfo']['domain']['nserver'] = array();
$r['regrinfo']['admin'] = array();
$r['regrinfo']['tech'] = array();
$r['regrinfo']['billing'] = array();
$r['regrinfo']['owner'] = array();
$lastk = '';
while (list($key, $val) = each($data_str["rawdata"]))
while (list($key, $val) = each($data_str['rawdata']))
{
$val = trim($val);
if ($val != "")
if ($val != '')
{
foreach($contacts as $key => $contact)
{
if (strstr($val, "CONTACTO $contact:"))
{
preg_match("/CONTACTO $contact:\s*(.+?)\s*\[(.+?)\]/", $val, $refs);
$r["regrinfo"][$key]["name"] = $refs[1];
$r["regrinfo"][$key]["handle"] = $refs[2];
}
}
if (strstr($val, "ORGANIZACION:"))
{
preg_match("/ORGANIZACION:\s*(.+?)\s*\[(.+?)\]/", $val, $refs);
$r["regrinfo"]["owner"]["name"] = $refs[1];
$r["regrinfo"]["owner"]["handle"] = $refs[2];
}
else if (strstr($val, "SERVIDOR PRIMARIO:"))
{
$r["regrinfo"]["domain"]["nserver"][] = trim(substr($val, strlen("SERVIDOR PRIMARIO:")));
}
else if (strstr($val, "SERVIDOR SECUNDARIO:"))
{
$r["regrinfo"]["domain"]["nserver"][] = trim(substr($val, strlen("SERVIDOR SECUNDARIO:")));
}
else
{
reset($items);
while (list($field, $match) = each($items))
if (strstr($val, $match))
{
$r["regrinfo"]["domain"][$field] = trim(substr($val, strlen($match)));
$r['regrinfo'][$key]['name'] = $refs[1];
$r['regrinfo'][$key]['handle'] = $refs[2];
$lastk = $key;
break;
}
}
if (strstr($val, 'ORGANIZACION:'))
{
preg_match('/ORGANIZACION:\s*(.+?)\s*\[(.+?)\]/', $val, $refs);
$r['regrinfo']['owner']['name'] = $refs[1];
$r['regrinfo']['owner']['handle'] = $refs[2];
continue;
}
if (strstr($val, 'SERVIDOR DNS '))
{
$r['regrinfo']['domain']['nserver'][] = trim(substr($val, 16));
continue;
}
if (strstr($val, 'DOMICILIO:'))
{
if ($lastk == '') $lastk = 'owner';
$r['regrinfo'][$lastk]['address'] = trim(substr($val, 11));
continue;
}
reset($items);
while (list($field, $match) = each($items))
if (strstr($val, $match))
{
$r['regrinfo']['domain'][$field] = trim(substr($val, strlen($match)));
break;
}
}
}
if (!empty($r["regrinfo"]["owner"]["name"]))
if (!empty($r['regrinfo']['owner']['name']))
{
$r["regyinfo"] = array(
"referrer" => "http://www.nic.mx",
"registrar" => "NIC-Mexico"
$r['regyinfo'] = array(
'referrer' => 'http://www.nic.mx',
'registrar' => 'NIC-Mexico'
);
}
else
$r = "";
$r = '';
format_dates($r, 'dmy');
return ($r);

View file

@ -35,83 +35,34 @@ class pl_handler
function parse($data_str, $query)
{
$items = array(
'owner' => 'SUBSCRIBERS CONTACT OBJECT:',
'domain' => 'DOMAIN OBJECT:',
'tech' => 'Technical Contact:'
'created:' => 'domain.created',
'last modified' => 'domain.changed',
'REGISTRAR:' => 'domain.sponsor',
"registrant's handle:" => 'owner.handle',
);
$fields = array (
'company:' => 'organization',
'street:' => 'address.street',
'city:' => 'address.city',
'location:' => 'address.country',
'handle:' => 'handle',
'created:' => 'created',
'last modified:' => 'changed',
'registrar:' => 'sponsor',
'phone:' => 'phone'
);
$r = get_blocks($data_str['rawdata'], $items);
if (isset($r['tech']))
{
if ($r['tech'] == 'data restricted')
unset($r['tech']);
else
$r['tech'] = generic_parser_b($r['tech'], $fields, 'ymd', false);
}
if (isset($r['owner']))
{
if ($r['owner'] == 'data restricted')
unset($r['owner']);
else
$r['owner'] = generic_parser_b($r['owner'], $fields, 'ymd', false);
$r['domain'] = generic_parser_b($r['domain'], $fields, 'ymd', false);
if (isset($r['domain']['handle']))
{
$r['owner']['handle'] = $r['domain']['handle'];
unset($r['domain']['handle']);
}
// Get name servers
$r['regrinfo'] = generic_parser_b($data_str['rawdata'], $items, 'ymd');
if ($r['regrinfo']['registered'] == 'yes')
{
$found = false;
$ns = array();
foreach ($data_str['rawdata'] as $line)
foreach($data_str['rawdata'] as $line)
{
if (substr($line,0,9) == 'nservers:')
if ($found)
{
if (strpos($line,':')) break;
$r['regrinfo']['domain']['nserver'][] = $line;
}
if (strpos($line,'nameservers:') !== false)
{
$found = true;
$ns[] = strtok(trim(substr($line,9)),'[');
$r['regrinfo']['domain']['nserver'][] = substr($line,13);
}
else
if ($found)
{
if (substr($line,0,8) == 'created:')
break;
else
$ns[] = strtok($line,'[');
}
}
$r = array ( 'regrinfo' => $r );
if (isset($r['regrinfo']['owner']['address']['city']))
$r['regrinfo']['owner']['address'] = $this->extract_zipcode($r['regrinfo']['owner']['address']);
if (isset($r['regrinfo']['tech']['address']['city']))
$r['regrinfo']['tech']['address'] = $this->extract_zipcode($r['regrinfo']['owner']['address']);
$r['domain']['nserver'] = $ns;
$r['registered'] = 'yes';
}
else
$r['regrinfo']['registered'] = 'no';
$r['regyinfo'] = array(
'referrer' => 'http://www.dns.pl/english/index.html',
@ -120,15 +71,5 @@ class pl_handler
return ($r);
}
function extract_zipcode ($addr)
{
if(preg_match('/(\d{2}-\d{3}) (\w+)/',$addr['city'],$match))
{
$addr['city']=$match[2];
$addr['pcode']=$match[1];
}
return $addr;
}
}
?>

View file

@ -121,7 +121,8 @@ $this->WHOIS_GTLD_HANDLER = array(
'whois.namesdirect.com' => 'dotster',
'whois.psi-usa.info' => 'psiusa',
'whois.www.tv' => 'tvcorp',
'whois.tucows.com' => 'opensrs'
'whois.tucows.com' => 'opensrs',
'whois.35.com' => 'onlinenic'
);
/* Non ICANN TLD's */

View file

@ -31,7 +31,7 @@ sc admin.sc
se nic-se.se
uk olsns.co.uk
us neustar.us
ws samoanic.ws informe.ws
ws samoanic.ws
.co.za sex.co.za
.org.za sex.org.za
@ -80,7 +80,7 @@ wwdomains wildwestdomains.com
aero nic.aero
biz neulevel.biz
cat dominis.cat
coop sex.coop nic.coop
coop smile.coop nic.coop
edu berkeley.edu
eu eurid.eu
info afilias.info

File diff suppressed because one or more lines are too long

View file

@ -37,21 +37,38 @@ class nominalia_handler
{
$items = array(
'owner' => 'Registrant:',
'admin' => 'Administrative contact:',
'tech' => 'Technical contact',
'domain.name' => 'Domain name:',
'domain.nserver.' => 'Domain Servers in listed order:',
'domain.created' => 'Record created on',
'domain.expires' => 'Record expires on'
'Domain name:' => 'domain.name',
'Primary Name Server Hostname:' => 'domain.nserver.0',
'Secondary Name Server Hostname:' =>'domain.nserver.1',
'Created on:' => 'domain.created',
'Expires on:' => 'domain.expires',
'Updated on:' => 'domain.changed',
'Registrant Name:' => 'owner.name',
'Registrant Address:' => 'owner.address.street',
'Registrant City:' => 'owner.address.city',
'Registrant Postal Code:' => 'owner.address.pcode',
'Registrant Country:' => 'owner.address.country',
'Administrative Contact Name:' => 'admin.name',
'Administrative Contact Organization:' => 'admin.organization',
'Administrative Contact Address:' => 'admin.address.street',
'Administrative Contact City:' => 'admin.address.city',
'Administrative Contact Postal Code:' => 'admin.address.pcode',
'Administrative Contact Country:' => 'admin.address.country',
'Administrative Contact Email:' => 'admin.email',
'Administrative Contact Tel:' => 'admin.phone',
'Administrative Contact Fax:' => 'admin.fax',
'Technical Contact Contact Name:' => 'tech.name',
'Technical Contact Contact Organization:' => 'tech.organization',
'Technical Contact Contact Address:' => 'tech.address.street',
'Technical Contact Contact City:' => 'tech.address.city',
'Technical Contact Contact Postal Code:' => 'tech.address.pcode',
'Technical Contact Contact Country:' => 'tech.address.country',
'Technical Contact Contact Email:' => 'tech.email',
'Technical Contact Contact Tel:' => 'tech.phone',
'Technical Contact Contact Fax:' => 'tech.fax'
);
$r = get_blocks($data_str, $items);
$r['owner'] = get_contact($r['owner']);
$r['admin'] = get_contact($r['admin']);
$r['tech'] = get_contact($r['tech']);
format_dates($r, 'ymd');
return ($r);
return generic_parser_b($data_str, $items, 'ymd');
}
}
?>