several handler fixes
This commit is contained in:
parent
e583589894
commit
f3846553e8
17 changed files with 350 additions and 350 deletions
19
Changes.md
19
Changes.md
|
@ -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
|
2008/04/28
|
||||||
- whois.za.php renamed to whois.zanet.php
|
- whois.za.php renamed to whois.zanet.php
|
||||||
- added support & handler for .org.za
|
- added support & handler for .org.za
|
||||||
|
@ -5,6 +23,7 @@
|
||||||
- minor improvemts on whois.client.php to allow
|
- minor improvemts on whois.client.php to allow
|
||||||
handlers for second level domains
|
handlers for second level domains
|
||||||
- improved nameserver detection
|
- improved nameserver detection
|
||||||
|
- minor fix to .ie handler
|
||||||
|
|
||||||
2008/03/05
|
2008/03/05
|
||||||
- dotregistrar is now part of dotster
|
- dotregistrar is now part of dotster
|
||||||
|
|
|
@ -37,57 +37,57 @@ class aero_handler
|
||||||
{
|
{
|
||||||
|
|
||||||
$items = array(
|
$items = array(
|
||||||
"Domain ID:" => "domain.handle",
|
'Domain ID:' => 'domain.handle',
|
||||||
"Domain Name:" => "domain.name",
|
'Domain Name:' => 'domain.name',
|
||||||
"Creation Date:" => "domain.created",
|
'Creation Date:' => 'domain.created',
|
||||||
'Last Modification Date:' => 'domain.changed',
|
'Last Modification Date:' => 'domain.changed',
|
||||||
"Expiration Date:" => "domain.expires",
|
'Expiration Date:' => 'domain.expires',
|
||||||
"Sponsoring Registrar:" => "domain.sponsor",
|
'Sponsoring Registrar:' => 'domain.sponsor',
|
||||||
"Name Server:" => "domain.nserver.",
|
'Name Server:' => 'domain.nserver.',
|
||||||
"Registrant ID:" => "owner.handle",
|
'Registrant ID:' => 'owner.handle',
|
||||||
"Registrant Name:" => "owner.name",
|
'Registrant Name:' => 'owner.name',
|
||||||
"Registrant Organization:" => "owner.organization",
|
'Registrant Organization:' => 'owner.organization',
|
||||||
"Registrant Address:" => "owner.address.street",
|
'Registrant Address:' => 'owner.address.street',
|
||||||
"Registrant City:" => "owner.address.city",
|
'Registrant City:' => 'owner.address.city',
|
||||||
'Registrant State/Province:' => 'owner.address.state',
|
'Registrant State/Province:' => 'owner.address.state',
|
||||||
"Registrant Postal Code:" => "owner.address.pcode",
|
'Registrant Postal Code:' => 'owner.address.pcode',
|
||||||
"Registrant Country:" => "owner.address.country",
|
'Registrant Country:' => 'owner.address.country',
|
||||||
"Registrant Phone Number:" => "owner.phone",
|
'Registrant Phone Number:' => 'owner.phone',
|
||||||
"Registrant Fax Number:" => "owner.fax",
|
'Registrant Fax Number:' => 'owner.fax',
|
||||||
"Registrant Email:" => "owner.email",
|
'Registrant Email:' => 'owner.email',
|
||||||
"Admin ID:" => "admin.handle",
|
'Admin ID:' => 'admin.handle',
|
||||||
"Admin Name:" => "admin.name",
|
'Admin Name:' => 'admin.name',
|
||||||
"Admin Organization:" => "admin.organization",
|
'Admin Organization:' => 'admin.organization',
|
||||||
"Admin Address:" => "admin.address.street",
|
'Admin Address:' => 'admin.address.street',
|
||||||
"Admin City:" => "admin.address.city",
|
'Admin City:' => 'admin.address.city',
|
||||||
"Admin State/Province:" => "admin.address.state",
|
'Admin State/Province:' => 'admin.address.state',
|
||||||
"Admin Postal Code:" => "admin.address.pcode",
|
'Admin Postal Code:' => 'admin.address.pcode',
|
||||||
"Admin Country:" => "admin.address.country",
|
'Admin Country:' => 'admin.address.country',
|
||||||
"Admin Phone Number:" => "admin.phone",
|
'Admin Phone Number:' => 'admin.phone',
|
||||||
"Admin Fax Number:" => "admin.fax",
|
'Admin Fax Number:' => 'admin.fax',
|
||||||
"Admin Email:" => "admin.email",
|
'Admin Email:' => 'admin.email',
|
||||||
"Tech ID:" => "tech.handle",
|
'Tech ID:' => 'tech.handle',
|
||||||
"Tech Name:" => "tech.name",
|
'Tech Name:' => 'tech.name',
|
||||||
"Tech Organization:" => "tech.organization",
|
'Tech Organization:' => 'tech.organization',
|
||||||
"Tech Address:" => "tech.address.street.",
|
'Tech Address:' => 'tech.address.street.',
|
||||||
"Tech City:" => "tech.address.city",
|
'Tech City:' => 'tech.address.city',
|
||||||
"Tech Postal Code:" => "tech.address.pcode",
|
'Tech Postal Code:' => 'tech.address.pcode',
|
||||||
"Tech State/Province:" => "tech.address.state",
|
'Tech State/Province:' => 'tech.address.state',
|
||||||
"Tech Country:" => "tech.address.country",
|
'Tech Country:' => 'tech.address.country',
|
||||||
"Tech Phone Number:" => "tech.phone",
|
'Tech Phone Number:' => 'tech.phone',
|
||||||
"Tech Fax Number:" => "tech.fax",
|
'Tech Fax Number:' => 'tech.fax',
|
||||||
"Tech Email:" => "tech.email",
|
'Tech Email:' => 'tech.email',
|
||||||
"Billing ID:" => "billing.handle",
|
'Billing ID:' => 'billing.handle',
|
||||||
"Billing Name:" => "billing.name",
|
'Billing Name:' => 'billing.name',
|
||||||
"Billing Organization:" => "billing.organization",
|
'Billing Organization:' => 'billing.organization',
|
||||||
"Billing Address:" => "billing.address.street",
|
'Billing Address:' => 'billing.address.street',
|
||||||
"Billing City:" => "billing.address.city",
|
'Billing City:' => 'billing.address.city',
|
||||||
"Billing Postal Code:" => "billing.address.pcode",
|
'Billing Postal Code:' => 'billing.address.pcode',
|
||||||
"Billing State/Province:" => "billing.address.state",
|
'Billing State/Province:' => 'billing.address.state',
|
||||||
"Billing Country:" => "billing.address.country",
|
'Billing Country:' => 'billing.address.country',
|
||||||
"Billing Phone Number:" => "billing.phone",
|
'Billing Phone Number:' => 'billing.phone',
|
||||||
"Billing Fax Number:" => "billing.fax",
|
'Billing Fax Number:' => 'billing.fax',
|
||||||
"Billing Email:" => "billing.email"
|
'Billing Email:' => 'billing.email'
|
||||||
);
|
);
|
||||||
|
|
||||||
$r['regyinfo'] = array(
|
$r['regyinfo'] = array(
|
||||||
|
|
|
@ -216,7 +216,10 @@ class WhoisClient {
|
||||||
$result = array( 'rawdata' => $output );
|
$result = array( 'rawdata' => $output );
|
||||||
$result = $this->set_whois_info($result);
|
$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']))
|
if (isSet($this->Query['handler']))
|
||||||
{
|
{
|
||||||
// Keep server list
|
// Keep server list
|
||||||
|
|
|
@ -62,7 +62,7 @@ class enom_handler
|
||||||
'domain.expires#2' => 'Registered through-'
|
'domain.expires#2' => 'Registered through-'
|
||||||
);
|
);
|
||||||
|
|
||||||
$r = get_blocks($data_str, $items);
|
$r = get_blocks($data_str, $items, true);
|
||||||
|
|
||||||
if (isset($r['owner']))
|
if (isset($r['owner']))
|
||||||
$r['owner'] = get_contact($r['owner'],false,true);
|
$r['owner'] = get_contact($r['owner'],false,true);
|
||||||
|
|
|
@ -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 2.0 David Saez Padros <david@ols.es> */
|
||||||
/* interdomain.whois 1.1 David Saez Padros <david@ols.es> */
|
/* interdomain.whois 1.1 David Saez Padros <david@ols.es> */
|
||||||
|
|
||||||
if (!defined("__INTERDOMAIN_HANDLER__"))
|
if (!defined('__INTERDOMAIN_HANDLER__'))
|
||||||
define("__INTERDOMAIN_HANDLER__", 1);
|
define('__INTERDOMAIN_HANDLER__', 1);
|
||||||
|
|
||||||
require_once('whois.parser.php');
|
require_once('whois.parser.php');
|
||||||
|
|
||||||
|
@ -40,47 +40,46 @@ class interdomain_handler
|
||||||
{
|
{
|
||||||
|
|
||||||
$items = array(
|
$items = array(
|
||||||
"Domain Name................" => "domain.name",
|
'Domain Name................' => 'domain.name',
|
||||||
"Creation Date............" => "domain.created",
|
'Creation Date............' => 'domain.created',
|
||||||
"Expiry Date.............." => "domain.expires",
|
'Expiry Date..............' => 'domain.expires',
|
||||||
"Last Update Date........." => "domain.changed",
|
'Last Update Date.........' => 'domain.changed',
|
||||||
"Name Server............." => "domain.nserver.",
|
'Name Server.............' => 'domain.nserver.',
|
||||||
"Organization Name........" => "owner.name",
|
'Organization Name........' => 'owner.name',
|
||||||
"Organization Org........." => "owner.organization",
|
'Organization Org.........' => 'owner.organization',
|
||||||
"Organization Street......" => "owner.address.street",
|
'Organization Street......' => 'owner.address.street',
|
||||||
"Organization City........" => "owner.address.city",
|
'Organization City........' => 'owner.address.city',
|
||||||
"Organization State......." => "owner.address.state",
|
'Organization State.......' => 'owner.address.state',
|
||||||
"Organization PC.........." => "owner.address.pcode",
|
'Organization PC..........' => 'owner.address.pcode',
|
||||||
"Organization Country....." => "owner.address.country",
|
'Organization Country.....' => 'owner.address.country',
|
||||||
"Organization Phone......." => "owner.phone",
|
'Organization Phone.......' => 'owner.phone',
|
||||||
"Organization e-mail......" => "owner.email",
|
'Organization e-mail......' => 'owner.email',
|
||||||
"Organization Contact Id...." => "owner.handle",
|
'Organization Contact Id....' => 'owner.handle',
|
||||||
"Administrative Contact Id.." => "admin.handle",
|
'Administrative Contact Id..' => 'admin.handle',
|
||||||
"Administrative Name......" => "admin.name",
|
'Administrative Name......' => 'admin.name',
|
||||||
"Administrative Org......." => "admin.organization",
|
'Administrative Org.......' => 'admin.organization',
|
||||||
"Administrative Street...." => "admin.address.street",
|
'Administrative Street....' => 'admin.address.street',
|
||||||
"Administrative City......" => "admin.address.city",
|
'Administrative City......' => 'admin.address.city',
|
||||||
"Administrative State....." => "admin.address.state",
|
'Administrative State.....' => 'admin.address.state',
|
||||||
"Administrative PC........" => "admin.address.pcode",
|
'Administrative PC........' => 'admin.address.pcode',
|
||||||
"Administrative Country..." => "admin.address.country",
|
'Administrative Country...' => 'admin.address.country',
|
||||||
"Administrative Phone....." => "admin.phone",
|
'Administrative Phone.....' => 'admin.phone',
|
||||||
"Administrative e-mail...." => "admin.email",
|
'Administrative e-mail....' => 'admin.email',
|
||||||
"Administrative Fax......." => "admin.fax",
|
'Administrative Fax.......' => 'admin.fax',
|
||||||
"Technical Contact Id......." => "tech.handle",
|
'Technical Contact Id.......' => 'tech.handle',
|
||||||
"Technical Name..........." => "tech.name",
|
'Technical Name...........' => 'tech.name',
|
||||||
"Technical Org............" => "tech.organization",
|
'Technical Org............' => 'tech.organization',
|
||||||
"Technical Street........." => "tech.address.street",
|
'Technical Street.........' => 'tech.address.street',
|
||||||
"Technical City..........." => "tech.address.city",
|
'Technical City...........' => 'tech.address.city',
|
||||||
"Technical State.........." => "tech.address.state",
|
'Technical State..........' => 'tech.address.state',
|
||||||
"Technical PC............." => "tech.address.pcode",
|
'Technical PC.............' => 'tech.address.pcode',
|
||||||
"Technical Country........" => "tech.address.country",
|
'Technical Country........' => 'tech.address.country',
|
||||||
"Technical Phone.........." => "tech.phone",
|
'Technical Phone..........' => 'tech.phone',
|
||||||
"Technical e-mail........." => "tech.email",
|
'Technical e-mail.........' => 'tech.email',
|
||||||
"Technical Fax............" => "tech.fax"
|
'Technical Fax............' => 'tech.fax'
|
||||||
);
|
);
|
||||||
|
|
||||||
$ret = generic_parser_b($data_str, $items, 'dmy');
|
return generic_parser_b($data_str, $items, 'dmy');
|
||||||
return $ret;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,15 @@ class onlinenic_handler
|
||||||
if (isset($r['bill']))
|
if (isset($r['bill']))
|
||||||
$r['bill'] = get_contact($r['bill'],$extra);
|
$r['bill'] = get_contact($r['bill'],$extra);
|
||||||
|
|
||||||
|
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');
|
format_dates($r['domain'], 'mdy');
|
||||||
return ($r);
|
return ($r);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,29 +35,25 @@ class ovh_handler
|
||||||
|
|
||||||
function parse($data_str, $query)
|
function parse($data_str, $query)
|
||||||
{
|
{
|
||||||
$translate = array(
|
$items = array(
|
||||||
'nic-hdl' => 'handle',
|
'owner' => 'Registrant:',
|
||||||
'person' => 'name',
|
'admin' => 'Administrative Contact:',
|
||||||
'adresse' => 'address'
|
'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(
|
$r = get_blocks($data_str, $items, true);
|
||||||
'tech-c' => 'tech',
|
|
||||||
'admin-c' => 'admin',
|
|
||||||
'bill-c' => 'billing'
|
|
||||||
);
|
|
||||||
|
|
||||||
$r = generic_parser_a($data_str, $translate, $contacts, 'owner', 'ymd');
|
$r['owner'] = get_contact($r['owner']);
|
||||||
|
$r['admin'] = get_contact($r['admin']);
|
||||||
if (isset($r['owner']['domain']))
|
$r['tech'] = get_contact($r['tech']);
|
||||||
{
|
$r['billing'] = get_contact($r['billing']);
|
||||||
unset($r['owner']['domain']);
|
|
||||||
unset($r['owner']['nserver']);
|
|
||||||
unset($r['owner']['created']);
|
|
||||||
unset($r['owner']['expires']);
|
|
||||||
unset($r['owner']['changed']);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
format_dates($r, 'mdy');
|
||||||
return ($r);
|
return ($r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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> */
|
/* schlund.whois 1.00 David Saez <david@ols.es> */
|
||||||
|
|
||||||
if (!defined("__SCHLUND_HANDLER__"))
|
if (!defined('__SCHLUND_HANDLER__'))
|
||||||
define("__SCHLUND_HANDLER__", 1);
|
define('__SCHLUND_HANDLER__', 1);
|
||||||
|
|
||||||
require_once('whois.parser.php');
|
require_once('whois.parser.php');
|
||||||
|
|
||||||
|
@ -39,49 +39,49 @@ class schlund_handler
|
||||||
{
|
{
|
||||||
|
|
||||||
$items = array(
|
$items = array(
|
||||||
"created:" => "domain.created",
|
'created:' => 'domain.created',
|
||||||
"last-changed:" => "domain.changed",
|
'last-changed:' => 'domain.changed',
|
||||||
"status:" => "domain.status",
|
'status:' => 'domain.status',
|
||||||
"registrant-firstname:" => "owner.name.first",
|
'registrant-firstname:' => 'owner.name.first',
|
||||||
"registrant-lastname:" => "owner.name.last",
|
'registrant-lastname:' => 'owner.name.last',
|
||||||
"registrant-organization:" => "owner.organization",
|
'registrant-organization:' => 'owner.organization',
|
||||||
"registrant-street1:" => "owner.address.street.",
|
'registrant-street1:' => 'owner.address.street.',
|
||||||
"registrant-street2:" => "owner.address.street.",
|
'registrant-street2:' => 'owner.address.street.',
|
||||||
"registrant-pcode:" => "owner.address.pcode",
|
'registrant-pcode:' => 'owner.address.pcode',
|
||||||
"registrant-city:" => "owner.address.city",
|
'registrant-city:' => 'owner.address.city',
|
||||||
"registrant-ccode:" => "owner.address.country",
|
'registrant-ccode:' => 'owner.address.country',
|
||||||
"registrant-phone:" => "owner.phone",
|
'registrant-phone:' => 'owner.phone',
|
||||||
"registrant-email:" => "onwer.email",
|
'registrant-email:' => 'onwer.email',
|
||||||
"admin-c-firstname:" => "admin.name.first",
|
'admin-c-firstname:' => 'admin.name.first',
|
||||||
"admin-c-lastname:" => "admin.name.last",
|
'admin-c-lastname:' => 'admin.name.last',
|
||||||
"admin-c-organization:" => "admin.organization",
|
'admin-c-organization:' => 'admin.organization',
|
||||||
"admin-c-street1:" => "admin.address.street.",
|
'admin-c-street1:' => 'admin.address.street.',
|
||||||
"admin-c-street2:" => "admin.address.street.",
|
'admin-c-street2:' => 'admin.address.street.',
|
||||||
"admin-c-pcode:" => "admin.address.pcode",
|
'admin-c-pcode:' => 'admin.address.pcode',
|
||||||
"admin-c-city:" => "admin.address.city",
|
'admin-c-city:' => 'admin.address.city',
|
||||||
"admin-c-ccode:" => "admin.address.country",
|
'admin-c-ccode:' => 'admin.address.country',
|
||||||
"admin-c-phone:" => "admin.phone",
|
'admin-c-phone:' => 'admin.phone',
|
||||||
"admin-c-email:" => "admin.email",
|
'admin-c-email:' => 'admin.email',
|
||||||
"tech-c-firstname:" => "tech.name.first",
|
'tech-c-firstname:' => 'tech.name.first',
|
||||||
"tech-c-lastname:" => "tech.name.last",
|
'tech-c-lastname:' => 'tech.name.last',
|
||||||
"tech-c-organization:" => "tech.organization",
|
'tech-c-organization:' => 'tech.organization',
|
||||||
"tech-c-street1:" => "tech.address.street.",
|
'tech-c-street1:' => 'tech.address.street.',
|
||||||
"tech-c-street2:" => "tech.address.street.",
|
'tech-c-street2:' => 'tech.address.street.',
|
||||||
"tech-c-pcode:" => "tech.address.pcode",
|
'tech-c-pcode:' => 'tech.address.pcode',
|
||||||
"tech-c-city:" => "tech.address.city",
|
'tech-c-city:' => 'tech.address.city',
|
||||||
"tech-c-ccode:" => "tech.address.country",
|
'tech-c-ccode:' => 'tech.address.country',
|
||||||
"tech-c-phone:" => "tech.phone",
|
'tech-c-phone:' => 'tech.phone',
|
||||||
"tech-c-email:" => "tech.email",
|
'tech-c-email:' => 'tech.email',
|
||||||
"bill-c-firstname:" => "billing.name.first",
|
'bill-c-firstname:' => 'billing.name.first',
|
||||||
"bill-c-lastname:" => "billing.name.last",
|
'bill-c-lastname:' => 'billing.name.last',
|
||||||
"bill-c-organization:" => "billing.organization",
|
'bill-c-organization:' => 'billing.organization',
|
||||||
"bill-c-street1:" => "billing.address.street.",
|
'bill-c-street1:' => 'billing.address.street.',
|
||||||
"bill-c-street2:" => "billing.address.street.",
|
'bill-c-street2:' => 'billing.address.street.',
|
||||||
"bill-c-pcode:" => "billing.address.pcode",
|
'bill-c-pcode:' => 'billing.address.pcode',
|
||||||
"bill-c-city:" => "billing.address.city",
|
'bill-c-city:' => 'billing.address.city',
|
||||||
"bill-c-ccode:" => "billing.address.country",
|
'bill-c-ccode:' => 'billing.address.country',
|
||||||
"bill-c-phone:" => "billing.phone",
|
'bill-c-phone:' => 'billing.phone',
|
||||||
"bill-c-email:" => "billing.email"
|
'bill-c-email:' => 'billing.email'
|
||||||
);
|
);
|
||||||
|
|
||||||
$r = generic_parser_b($data_str, $items);
|
$r = generic_parser_b($data_str, $items);
|
||||||
|
|
|
@ -39,6 +39,7 @@ class ie_handler
|
||||||
$translate = array(
|
$translate = array(
|
||||||
'nic-hdl' => 'handle',
|
'nic-hdl' => 'handle',
|
||||||
'person' => 'name',
|
'person' => 'name',
|
||||||
|
'renewal' => 'expires'
|
||||||
);
|
);
|
||||||
|
|
||||||
$contacts = array(
|
$contacts = array(
|
||||||
|
|
|
@ -285,8 +285,7 @@ class Whois extends WhoisClient
|
||||||
$result['regrinfo']['registered'] = 'unknown';
|
$result['regrinfo']['registered'] = 'unknown';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($result['regrinfo']['domain']['nserver']))
|
if (!isset($result['regrinfo']['domain']['nserver'])) return;
|
||||||
return ;
|
|
||||||
|
|
||||||
// Normalize nameserver fields
|
// Normalize nameserver fields
|
||||||
$nserver = $result['regrinfo']['domain']['nserver'];
|
$nserver = $result['regrinfo']['domain']['nserver'];
|
||||||
|
@ -299,7 +298,7 @@ class Whois extends WhoisClient
|
||||||
|
|
||||||
$dns = array();
|
$dns = array();
|
||||||
|
|
||||||
while (list($key, $val) = each($nserver))
|
foreach($nserver as $val)
|
||||||
{
|
{
|
||||||
$val = str_replace( array('[',']','(',')'), '', trim($val));
|
$val = str_replace( array('[',']','(',')'), '', trim($val));
|
||||||
$val = str_replace("\t", ' ', $val);
|
$val = str_replace("\t", ' ', $val);
|
||||||
|
@ -309,10 +308,15 @@ class Whois extends WhoisClient
|
||||||
|
|
||||||
foreach($parts as $p)
|
foreach($parts as $p)
|
||||||
{
|
{
|
||||||
|
if (substr($p,-1) == '.') $p = substr($p,0,-1);
|
||||||
|
|
||||||
if ((ip2long($p) == - 1) or (ip2long($p) === false))
|
if ((ip2long($p) == - 1) or (ip2long($p) === false))
|
||||||
{
|
{
|
||||||
// Hostname ?
|
// Hostname ?
|
||||||
if (strpos($p,'.')) $host = $p;
|
if ($host == '' && preg_match('/^[\w\-]+(\.[\w\-]+)+$/',$p))
|
||||||
|
{
|
||||||
|
$host = $p;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// IP Address
|
// IP Address
|
||||||
|
|
|
@ -37,52 +37,52 @@ class museum_handler
|
||||||
{
|
{
|
||||||
|
|
||||||
$items = array(
|
$items = array(
|
||||||
"ENS Identity:" => "domain.handle",
|
'Domain ID:' => 'domain.handle',
|
||||||
"Domain Name:" => "domain.name",
|
'Domain Name:' => 'domain.name',
|
||||||
"Created On:" => "domain.created",
|
'Created On:' => 'domain.created',
|
||||||
"Expires ON:" => "domain.expires",
|
'Expiration Date:' => 'domain.expires',
|
||||||
"Sponsoring Registrar:" => "domain.sponsor",
|
'Registrar ID:' => 'domain.sponsor',
|
||||||
"Name Server:" => "domain.nserver.",
|
'Name Server:' => 'domain.nserver.',
|
||||||
"Registrant ID:" => "owner.handle",
|
'Registrant ID:' => 'owner.handle',
|
||||||
"Registrant Name:" => "owner.name",
|
'Registrant Name:' => 'owner.name',
|
||||||
"Registrant Organization:" => "owner.organization",
|
'Registrant Organization:'=> 'owner.organization',
|
||||||
"Registrant Address:" => "owner.address.street",
|
'Registrant Street:' => 'owner.address.street',
|
||||||
"Registrant City:" => "owner.address.city",
|
'Registrant City:' => 'owner.address.city',
|
||||||
"Registrant Postal Code:" => "owner.address.pcode",
|
'Registrant Postal Code:' => 'owner.address.pcode',
|
||||||
"Registrant Country:" => "owner.address.country",
|
'Registrant Country:' => 'owner.address.country',
|
||||||
"Registrant Phone Number:" => "owner.phone",
|
'Registrant Phone:' => 'owner.phone',
|
||||||
"Registrant Fax Number:" => "owner.fax",
|
'Registrant Fax:' => 'owner.fax',
|
||||||
"Registrant Email:" => "owner.email",
|
'Registrant Email:' => 'owner.email',
|
||||||
"Admin ID:" => "admin.handle",
|
'Admin ID:' => 'admin.handle',
|
||||||
"Admin Name:" => "admin.name",
|
'Admin Name:' => 'admin.name',
|
||||||
"Admin Organization:" => "admin.organization",
|
'Admin Organization:' => 'admin.organization',
|
||||||
"Admin Address:" => "admin.address.street",
|
'Admin Street:' => 'admin.address.street',
|
||||||
"Admin City:" => "admin.address.city",
|
'Admin City:' => 'admin.address.city',
|
||||||
"Admin Postal Code:" => "admin.address.pcode",
|
'Admin Postal Code:' => 'admin.address.pcode',
|
||||||
"Admin Country:" => "admin.address.country",
|
'Admin Country:' => 'admin.address.country',
|
||||||
"Admin Phone Number:" => "admin.phone",
|
'Admin Phone:' => 'admin.phone',
|
||||||
"Admin Fax Number:" => "admin.fax",
|
'Admin Fax:' => 'admin.fax',
|
||||||
"Admin Email:" => "admin.email",
|
'Admin Email:' => 'admin.email',
|
||||||
"Tech ID:" => "tech.handle",
|
'Tech ID:' => 'tech.handle',
|
||||||
"Tech Name:" => "tech.name",
|
'Tech Name:' => 'tech.name',
|
||||||
"Tech Organization:" => "tech.organization",
|
'Tech Organization:' => 'tech.organization',
|
||||||
"Tech Address:" => "tech.address.street.",
|
'Tech Street:' => 'tech.address.street.',
|
||||||
"Tech City:" => "tech.address.city",
|
'Tech City:' => 'tech.address.city',
|
||||||
"Tech Postal Code:" => "tech.address.pcode",
|
'Tech Postal Code:' => 'tech.address.pcode',
|
||||||
"Tech Country:" => "tech.address.country",
|
'Tech Country:' => 'tech.address.country',
|
||||||
"Tech Phone Number:" => "tech.phone",
|
'Tech Phone:' => 'tech.phone',
|
||||||
"Tech Fax Number:" => "tech.fax",
|
'Tech Fax:' => 'tech.fax',
|
||||||
"Tech Email:" => "tech.email",
|
'Tech Email:' => 'tech.email',
|
||||||
"Billing ID:" => "billing.handle",
|
'Billing ID:' => 'billing.handle',
|
||||||
"Billing Name:" => "billing.name",
|
'Billing Name:' => 'billing.name',
|
||||||
"Billing Organization:" => "billing.organization",
|
'Billing Organization:' => 'billing.organization',
|
||||||
"Billing Address:" => "billing.address.street",
|
'Billing Street:' => 'billing.address.street',
|
||||||
"Billing City:" => "billing.address.city",
|
'Billing City:' => 'billing.address.city',
|
||||||
"Billing Postal Code:" => "billing.address.pcode",
|
'Billing Postal Code:' => 'billing.address.pcode',
|
||||||
"Billing Country:" => "billing.address.country",
|
'Billing Country:' => 'billing.address.country',
|
||||||
"Billing Phone Number:" => "billing.phone",
|
'Billing Phone:' => 'billing.phone',
|
||||||
"Billing Fax Number:" => "billing.fax",
|
'Billing Fax:' => 'billing.fax',
|
||||||
"Billing Email:" => "billing.email"
|
'Billing Email:' => 'billing.email'
|
||||||
);
|
);
|
||||||
|
|
||||||
$r['regyinfo'] = array(
|
$r['regyinfo'] = array(
|
||||||
|
|
|
@ -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 */
|
/* mxnic.whois 1.0 Torfinn Nome <torfinn@nome.no> 2003-02-15 */
|
||||||
/* Based upon info.whois by David Saez Padros <david@ols.es> */
|
/* Based upon info.whois by David Saez Padros <david@ols.es> */
|
||||||
|
|
||||||
if (!defined("__MX_HANDLER__"))
|
if (!defined('__MX_HANDLER__'))
|
||||||
define("__MX_HANDLER__", 1);
|
define('__MX_HANDLER__', 1);
|
||||||
|
|
||||||
require_once('whois.parser.php');
|
require_once('whois.parser.php');
|
||||||
|
|
||||||
|
@ -40,77 +40,87 @@ class mx_handler
|
||||||
{
|
{
|
||||||
|
|
||||||
$contacts = array(
|
$contacts = array(
|
||||||
"admin" => "ADMINISTRATIVO",
|
'admin' => 'ADMINISTRATIVO',
|
||||||
"tech" => "TECNICO",
|
'tech' => 'TECNICO',
|
||||||
"billing" => "DE PAGO"
|
'billing' => 'DE PAGO'
|
||||||
);
|
);
|
||||||
|
|
||||||
$items = array(
|
$items = array(
|
||||||
"name" => "DOMINIO:",
|
'name' => 'DOMINIO:',
|
||||||
"created" => "FECHA DE CREACION:",
|
'created' => 'FECHA DE CREACION:',
|
||||||
"changed" => "FECHA DE ULTIMA MODIFICACION:"
|
'changed' => 'FECHA DE ULTIMA MODIFICACION:'
|
||||||
);
|
);
|
||||||
|
|
||||||
$r["regrinfo"] = array();
|
$r['regrinfo'] = array();
|
||||||
$r["regrinfo"]["domain"]["nserver"] = array();
|
$r['regrinfo']['domain']['nserver'] = array();
|
||||||
$r["regrinfo"]["admin"] = array();
|
$r['regrinfo']['admin'] = array();
|
||||||
$r["regrinfo"]["tech"] = array();
|
$r['regrinfo']['tech'] = array();
|
||||||
$r["regrinfo"]["billing"] = array();
|
$r['regrinfo']['billing'] = array();
|
||||||
$r["regrinfo"]["owner"] = 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);
|
$val = trim($val);
|
||||||
|
|
||||||
if ($val != "")
|
if ($val != '')
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach($contacts as $key => $contact)
|
foreach($contacts as $key => $contact)
|
||||||
{
|
{
|
||||||
if (strstr($val, "CONTACTO $contact:"))
|
if (strstr($val, "CONTACTO $contact:"))
|
||||||
{
|
{
|
||||||
preg_match("/CONTACTO $contact:\s*(.+?)\s*\[(.+?)\]/", $val, $refs);
|
preg_match("/CONTACTO $contact:\s*(.+?)\s*\[(.+?)\]/", $val, $refs);
|
||||||
$r["regrinfo"][$key]["name"] = $refs[1];
|
$r['regrinfo'][$key]['name'] = $refs[1];
|
||||||
$r["regrinfo"][$key]["handle"] = $refs[2];
|
$r['regrinfo'][$key]['handle'] = $refs[2];
|
||||||
|
$lastk = $key;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (strstr($val, "ORGANIZACION:"))
|
|
||||||
|
if (strstr($val, 'ORGANIZACION:'))
|
||||||
{
|
{
|
||||||
preg_match("/ORGANIZACION:\s*(.+?)\s*\[(.+?)\]/", $val, $refs);
|
preg_match('/ORGANIZACION:\s*(.+?)\s*\[(.+?)\]/', $val, $refs);
|
||||||
$r["regrinfo"]["owner"]["name"] = $refs[1];
|
$r['regrinfo']['owner']['name'] = $refs[1];
|
||||||
$r["regrinfo"]["owner"]["handle"] = $refs[2];
|
$r['regrinfo']['owner']['handle'] = $refs[2];
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else if (strstr($val, "SERVIDOR PRIMARIO:"))
|
|
||||||
|
if (strstr($val, 'SERVIDOR DNS '))
|
||||||
{
|
{
|
||||||
$r["regrinfo"]["domain"]["nserver"][] = trim(substr($val, strlen("SERVIDOR PRIMARIO:")));
|
$r['regrinfo']['domain']['nserver'][] = trim(substr($val, 16));
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else if (strstr($val, "SERVIDOR SECUNDARIO:"))
|
|
||||||
|
if (strstr($val, 'DOMICILIO:'))
|
||||||
{
|
{
|
||||||
$r["regrinfo"]["domain"]["nserver"][] = trim(substr($val, strlen("SERVIDOR SECUNDARIO:")));
|
if ($lastk == '') $lastk = 'owner';
|
||||||
|
$r['regrinfo'][$lastk]['address'] = trim(substr($val, 11));
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
reset($items);
|
reset($items);
|
||||||
|
|
||||||
while (list($field, $match) = each($items))
|
while (list($field, $match) = each($items))
|
||||||
|
|
||||||
if (strstr($val, $match))
|
if (strstr($val, $match))
|
||||||
{
|
{
|
||||||
$r["regrinfo"]["domain"][$field] = trim(substr($val, strlen($match)));
|
$r['regrinfo']['domain'][$field] = trim(substr($val, strlen($match)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($r["regrinfo"]["owner"]["name"]))
|
if (!empty($r['regrinfo']['owner']['name']))
|
||||||
{
|
{
|
||||||
$r["regyinfo"] = array(
|
$r['regyinfo'] = array(
|
||||||
"referrer" => "http://www.nic.mx",
|
'referrer' => 'http://www.nic.mx',
|
||||||
"registrar" => "NIC-Mexico"
|
'registrar' => 'NIC-Mexico'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$r = "";
|
$r = '';
|
||||||
|
|
||||||
format_dates($r, 'dmy');
|
format_dates($r, 'dmy');
|
||||||
return ($r);
|
return ($r);
|
||||||
|
|
|
@ -35,83 +35,34 @@ class pl_handler
|
||||||
function parse($data_str, $query)
|
function parse($data_str, $query)
|
||||||
{
|
{
|
||||||
$items = array(
|
$items = array(
|
||||||
'owner' => 'SUBSCRIBERS CONTACT OBJECT:',
|
'created:' => 'domain.created',
|
||||||
'domain' => 'DOMAIN OBJECT:',
|
'last modified' => 'domain.changed',
|
||||||
'tech' => 'Technical Contact:'
|
'REGISTRAR:' => 'domain.sponsor',
|
||||||
|
"registrant's handle:" => 'owner.handle',
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$fields = array (
|
$r['regrinfo'] = generic_parser_b($data_str['rawdata'], $items, 'ymd');
|
||||||
'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 ($r['regrinfo']['registered'] == 'yes')
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
$found = false;
|
$found = false;
|
||||||
$ns = array();
|
|
||||||
|
|
||||||
foreach ($data_str['rawdata'] as $line)
|
foreach($data_str['rawdata'] as $line)
|
||||||
{
|
{
|
||||||
if (substr($line,0,9) == 'nservers:')
|
|
||||||
{
|
|
||||||
$found = true;
|
|
||||||
$ns[] = strtok(trim(substr($line,9)),'[');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if ($found)
|
if ($found)
|
||||||
{
|
{
|
||||||
if (substr($line,0,8) == 'created:')
|
if (strpos($line,':')) break;
|
||||||
break;
|
$r['regrinfo']['domain']['nserver'][] = $line;
|
||||||
else
|
|
||||||
$ns[] = strtok($line,'[');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = array ( 'regrinfo' => $r );
|
if (strpos($line,'nameservers:') !== false)
|
||||||
|
{
|
||||||
if (isset($r['regrinfo']['owner']['address']['city']))
|
$found = true;
|
||||||
$r['regrinfo']['owner']['address'] = $this->extract_zipcode($r['regrinfo']['owner']['address']);
|
$r['regrinfo']['domain']['nserver'][] = substr($line,13);
|
||||||
|
}
|
||||||
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(
|
$r['regyinfo'] = array(
|
||||||
'referrer' => 'http://www.dns.pl/english/index.html',
|
'referrer' => 'http://www.dns.pl/english/index.html',
|
||||||
|
@ -120,15 +71,5 @@ class pl_handler
|
||||||
|
|
||||||
return ($r);
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -121,7 +121,8 @@ $this->WHOIS_GTLD_HANDLER = array(
|
||||||
'whois.namesdirect.com' => 'dotster',
|
'whois.namesdirect.com' => 'dotster',
|
||||||
'whois.psi-usa.info' => 'psiusa',
|
'whois.psi-usa.info' => 'psiusa',
|
||||||
'whois.www.tv' => 'tvcorp',
|
'whois.www.tv' => 'tvcorp',
|
||||||
'whois.tucows.com' => 'opensrs'
|
'whois.tucows.com' => 'opensrs',
|
||||||
|
'whois.35.com' => 'onlinenic'
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Non ICANN TLD's */
|
/* Non ICANN TLD's */
|
||||||
|
|
4
test.txt
4
test.txt
|
@ -31,7 +31,7 @@ sc admin.sc
|
||||||
se nic-se.se
|
se nic-se.se
|
||||||
uk olsns.co.uk
|
uk olsns.co.uk
|
||||||
us neustar.us
|
us neustar.us
|
||||||
ws samoanic.ws informe.ws
|
ws samoanic.ws
|
||||||
.co.za sex.co.za
|
.co.za sex.co.za
|
||||||
.org.za sex.org.za
|
.org.za sex.org.za
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ wwdomains wildwestdomains.com
|
||||||
aero nic.aero
|
aero nic.aero
|
||||||
biz neulevel.biz
|
biz neulevel.biz
|
||||||
cat dominis.cat
|
cat dominis.cat
|
||||||
coop sex.coop nic.coop
|
coop smile.coop nic.coop
|
||||||
edu berkeley.edu
|
edu berkeley.edu
|
||||||
eu eurid.eu
|
eu eurid.eu
|
||||||
info afilias.info
|
info afilias.info
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -37,21 +37,38 @@ class nominalia_handler
|
||||||
{
|
{
|
||||||
|
|
||||||
$items = array(
|
$items = array(
|
||||||
'owner' => 'Registrant:',
|
'Domain name:' => 'domain.name',
|
||||||
'admin' => 'Administrative contact:',
|
'Primary Name Server Hostname:' => 'domain.nserver.0',
|
||||||
'tech' => 'Technical contact',
|
'Secondary Name Server Hostname:' =>'domain.nserver.1',
|
||||||
'domain.name' => 'Domain name:',
|
'Created on:' => 'domain.created',
|
||||||
'domain.nserver.' => 'Domain Servers in listed order:',
|
'Expires on:' => 'domain.expires',
|
||||||
'domain.created' => 'Record created on',
|
'Updated on:' => 'domain.changed',
|
||||||
'domain.expires' => 'Record expires on'
|
'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);
|
return generic_parser_b($data_str, $items, 'ymd');
|
||||||
$r['owner'] = get_contact($r['owner']);
|
|
||||||
$r['admin'] = get_contact($r['admin']);
|
|
||||||
$r['tech'] = get_contact($r['tech']);
|
|
||||||
format_dates($r, 'ymd');
|
|
||||||
return ($r);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in a new issue