several handlers fixed to work with improved parser

This commit is contained in:
sparc 2007-04-29 09:22:30 +00:00
parent 6621b56f6e
commit 34ea2317ed
28 changed files with 191 additions and 164 deletions

View file

@ -1,3 +1,11 @@
200//04/29
- several improvments on whois.parser
- several handlers fixed to work with improved parser
2007/04/27
- rearranged regyinfo array
- better info reporting on ip whois
2007/04/26
- restrict .com/.net searches to domains
- regyinfo now contains a list of all servers

View file

@ -52,15 +52,17 @@ class edu_handler
if (isset($b['owner']))
{
$b['owner'] = get_contact($b['owner']);
array_pop($b['owner']['address']);
}
if (isset($b['admin']))
if (isset($b['admin']))
{
$b['admin'] = get_contact($b['admin']);
}
if (isset($b['tech']))
{
$b['tech'] = get_contact($b['tech']);
if ($b['tech']['name'] == 'Same as above')
$b['tech'] = $b['admin'];
}

View file

@ -46,7 +46,7 @@ class fm_handler
);
$blocks = get_blocks($data['rawdata'], $items);
$items = array(
'FM Domain:' => 'name',
'Primary Hostname:' => 'nserver.0',
@ -69,7 +69,7 @@ class fm_handler
while (list($key, $val) = each($blocks))
{
$r['regrinfo'][$key] = generic_parser_b($val, $items);
$r['regrinfo'][$key] = generic_parser_b($val, $items, 'mdy', false);
}
$r['regyinfo']['referrer'] = 'http://www.dot.dm';

View file

@ -27,8 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* ascio.whois 1.0 David Saez Padros <david@ols.es> */
if (!defined("__ASCIO_HANDLER__"))
define("__ASCIO_HANDLER__", 1);
if (!defined('__ASCIO_HANDLER__'))
define('__ASCIO_HANDLER__', 1);
require_once('whois.parser.php');
@ -39,20 +39,20 @@ class ascio_handler
{
$items = array(
"owner" => "Registrant:",
"admin" => "Administrative ",
"tech" => "Technical ",
"domain.name" => "Domain name:",
"domain.nserver." => "Domain servers in listed order:",
"domain.created" => "Record created:",
"domain.expires" => "Record expires:",
"domain.changed" => "Record last updated:"
'owner' => 'Registrant:',
'admin' => 'Administrative ',
'tech' => 'Technical ',
'domain.name' => 'Domain name:',
'domain.nserver.' => 'Domain servers in listed order:',
'domain.created' => 'Record created:',
'domain.expires' => 'Record expires:',
'domain.changed' => 'Record last updated:'
);
$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 = get_blocks($data_str, $items, true);
$r['owner'] = get_contact($r['owner']);
$r['admin'] = get_contact($r['admin']);
$r['tech'] = get_contact($r['tech']);
format_dates($r, 'ymd');
return ($r);
}

View file

@ -40,15 +40,16 @@ class directnic_handler
'owner' => 'Registrant:',
'admin' => 'Administrative Contact',
'tech' => 'Technical Contact',
'domain.name' => 'Domain name:',
'domain.name' => 'Domain Name:',
'domain.sponsor' => 'Registration Service Provider:',
'domain.nserver' => 'Domain servers in listed order:',
'domain.changed' => 'Record last updated ',
'domain.created' => 'Record created on',
'domain.expires' => 'Record expires on'
'domain.created' => 'Record created on ',
'domain.expires' => 'Record expires on ',
'' => 'By submitting a WHOIS query'
);
$r = get_blocks($data_str, $items);
$r = get_blocks($data_str, $items, true);
$r['owner'] = get_contact($r['owner']);
$r['admin'] = get_contact($r['admin']);

View file

@ -47,7 +47,7 @@ class domaindiscover_handler
'domain.expires' => 'Domain expires on'
);
$r = get_blocks($data_str, $items);
$r = get_blocks($data_str, $items, true);
$r['owner'] = get_contact($r['owner']);
$r['admin'] = get_contact($r['admin']);

View file

@ -65,16 +65,16 @@ class enom_handler
$r = get_blocks($data_str, $items);
if (isset($r['owner']))
$r['owner'] = get_contact($r['owner']);
$r['owner'] = get_contact($r['owner'],false,true);
if (isset($r['admin']))
$r['admin'] = get_contact($r['admin']);
$r['admin'] = get_contact($r['admin'],false,true);
if (isset($r['tech']))
$r['tech'] = get_contact($r['tech']);
$r['tech'] = get_contact($r['tech'],false,true);
if (isset($r['billing']))
$r['billing'] = get_contact($r['billing']);
$r['billing'] = get_contact($r['billing'],false,true);
$r = format_dates($r, 'dmy');
return ($r);

View file

@ -27,8 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* godaddy.whois 1.0 David Saez Padros <david@ols.es> */
if (!defined("__GODADDY_HANDLER__"))
define("__GODADDY_HANDLER__", 1);
if (!defined('__GODADDY_HANDLER__'))
define('__GODADDY_HANDLER__', 1);
require_once('whois.parser.php');
@ -39,21 +39,21 @@ class godaddy_handler
{
$items = array(
"owner" => "Registrant:",
"admin" => "Administrative Contact",
"tech" => "Technical Contact",
"domain.name" => "Domain Name:",
"domain.nserver." => "Domain servers in listed order:",
"domain.created" => "Created on:",
"domain.expires" => "Expires on:",
"domain.changed" => "Last Updated on:",
"domain.sponsor" => "Registered through:"
'owner' => 'Registrant:',
'admin' => 'Administrative Contact',
'tech' => 'Technical Contact',
'domain.name' => 'Domain Name:',
'domain.nserver.' => 'Domain servers in listed order:',
'domain.created' => 'Created on:',
'domain.expires' => 'Expires on:',
'domain.changed' => 'Last Updated on:',
'domain.sponsor' => '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['owner'] = get_contact($r['owner']);
$r['admin'] = get_contact($r['admin'],false,true);
$r['tech'] = get_contact($r['tech'],false,true);
$r = format_dates($r, 'dmy');
return ($r);
}

View file

@ -53,13 +53,13 @@ class namejuice_handler
$r = get_blocks($data_str, $items);
if (isset($r['owner']))
$r['owner'] = get_contact($r['owner']);
$r['owner'] = get_contact($r['owner'],false,true);
if (isset($r['admin']))
$r['admin'] = get_contact($r['admin']);
$r['admin'] = get_contact($r['admin'],false,true);
if (isset($r['tech']))
$r['tech'] = get_contact($r['tech']);
$r['tech'] = get_contact($r['tech'],false,true);
$r = format_dates($r, 'dmy');
return ($r);

View file

@ -47,11 +47,11 @@ class networksolutions_handler
'domain.expires' => 'Record expires on'
);
$r = get_blocks($data_str, $items);
$r = get_blocks($data_str, $items, true);
if (isset($r['owner'])) $r['owner'] = get_contact($r['owner']);
if (isset($r['admin'])) $r['admin'] = get_contact($r['admin']);
if (isset($r['tech'])) $r['tech'] = get_contact($r['tech']);
if (isset($r['owner'])) $r['owner'] = get_contact($r['owner'],false,true);
if (isset($r['admin'])) $r['admin'] = get_contact($r['admin'],false,true);
if (isset($r['tech'])) $r['tech'] = get_contact($r['tech'],false,true);
$r = format_dates($r, 'dmy');

View file

@ -47,10 +47,10 @@ class nicco_handler
'domain.changed' => 'Last Updated on:'
);
$r = get_blocks($data_str, $items);
$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['admin'] = get_contact($r['admin'],false,true);
$r['tech'] = get_contact($r['tech'],false,true);
$r = format_dates($r, 'dmy');
return ($r);
}

View file

@ -42,6 +42,7 @@ class onlinenic_handler
'tech' => 'Technical Contactor:',
'bill' => 'Billing Contactor:',
'domain.name' => 'Domain name:',
'domain.name#' => 'Domain Name:',
'domain.nserver' => 'Domain servers in listed order:',
'domain.created' => 'Record created on ',
'domain.expires' => 'Record expired on ',
@ -61,12 +62,12 @@ class onlinenic_handler
'postcode:' => 'address.pcode',
'address:' => 'address.street',
'city:' => 'address.city',
'province:' => 'address.city.',
'province:' => '',
',province:' => '',
',country:' => 'address.country'
);
$r = get_blocks($data_str, $items);
$r = get_blocks($data_str, $items, true);
if (isset($r['owner']))
$r['owner'] = get_contact($r['owner'],$extra);

View file

@ -46,10 +46,11 @@ class opensrs_handler
'domain.nserver' => 'Domain servers in listed order:',
'domain.changed' => 'Record last updated on',
'domain.created' => 'Record created on',
'domain.expires' => 'Record expires on'
'domain.expires' => 'Record expires on',
'domain.sponsor' => 'Registrar of Record:'
);
$r = get_blocks($data_str, $items);
$r = get_blocks($data_str, $items, true);
if (isset($r['domain']['sponsor']) && is_array($r['domain']['sponsor']))
$r['domain']['sponsor'] = $r['domain']['sponsor'][0];

View file

@ -45,14 +45,16 @@ class publicdomainregistry_handler
'domain.nserver' => 'Domain servers in listed order:',
'domain.changed' => 'Record last updated ',
'domain.created' => 'Record created on',
'domain.expires' => 'Record expires on'
'domain.created#' => 'Creation Date:',
'domain.expires' => 'Record expires on',
'domain.expires#' => 'Expiration Date:'
);
$r = get_blocks($data_str, $items);
$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['owner'] = get_contact($r['owner'],false,true);
$r['admin'] = get_contact($r['admin'],false,true);
$r['tech'] = get_contact($r['tech'],false,true);
format_dates($r, 'mdy');
return ($r);
}

View file

@ -27,8 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* srsplus.whois 1.0 david@ols.es 11/4/2003 */
if (!defined("__SRSPLUS_HANDLER__"))
define("__SRSPLUS_HANDLER__", 1);
if (!defined('__SRSPLUS_HANDLER__'))
define('__SRSPLUS_HANDLER__', 1);
require_once('whois.parser.php');
@ -39,26 +39,26 @@ class srsplus_handler
{
$items = array(
"owner" => "Registrant:",
"admin" => "Administrative",
"tech" => "Technical",
"billing" => "Billing",
"domain.name" => "Domain name:",
"domain.nserver" => "Domain servers:",
"domain.created" => "Record created on",
"domain.expires" => "Record expires on"
'owner' => 'Registrant:',
'admin' => 'Administrative',
'tech' => 'Technical',
'billing' => 'Billing',
'domain.name' => 'Domain Name:',
'domain.nserver' => 'Domain servers:',
'domain.created' => 'Record created on',
'domain.expires' => 'Record expires on'
);
$r = get_blocks($data_str, $items);
$r = get_blocks($data_str, $items, true);
if (isset($r["owner"]))
$r["owner"] = get_contact($r["owner"]);
if (isset($r["admin"]))
$r["admin"] = get_contact($r["admin"]);
if (isset($r["tech"]))
$r["tech"] = get_contact($r["tech"]);
if (isset($r["billing"]))
$r["billing"] = get_contact($r["billing"]);
if (isset($r['owner']))
$r['owner'] = get_contact($r['owner'],false,true);
if (isset($r['admin']))
$r['admin'] = get_contact($r['admin'],false,true);
if (isset($r['tech']))
$r['tech'] = get_contact($r['tech'],false,true);
if (isset($r['billing']))
$r['billing'] = get_contact($r['billing'],false,true);
format_dates($r['domain'], 'mdy');
return ($r);
}

View file

@ -44,10 +44,11 @@ class tmagnic_handler
'domain.nserver.' => 'Domain servers in listed order:',
'domain.expires' => 'Record expires on: ',
'domain.changed' => 'Record last updated on: ',
'' => 'Zone Contact'
'' => 'Zone Contact',
'#' => 'Punycode Name:'
);
$r = get_blocks($data_str, $items);
$r = get_blocks($data_str, $items, true);
if (isset($r['owner'])) $r['owner'] = get_contact($r['owner']);
if (isset($r['admin'])) $r['admin'] = get_contact($r['admin']);

View file

@ -48,7 +48,7 @@ class lt_handler
'owner.name' => 'Registrar:',
'owner.email' => 'Registrar email:',
'domain.status' => 'Status:',
'domain.created' => 'Created:',
'domain.created' => 'Registered:',
'domain.changed' => 'Last updated:',
'domain.nserver.' => 'NS:',
'' => '%'

View file

@ -37,53 +37,54 @@ class name_handler
{
$items = array(
"Domain Name:" => "domain.name",
"Sponsoring Registrar:" => "domain.sponsor",
"Created On:" => "domain.created",
"Expires On:" => "domain.expires",
'Domain Name:' => 'domain.name',
'Domain Status:' => 'domain.status',
'Sponsoring Registrar:' => 'domain.sponsor',
'Created On:' => 'domain.created',
'Expires On:' => 'domain.expires',
'Updated On:' => 'domain.changed',
"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",
'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 State/Province:' => 'owner.address.state',
"Registrant Country:" => "owner.address.country",
"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",
'Registrant Country:' => 'owner.address.country',
'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 State/Province:' => 'admin.address.state',
"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",
'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",
'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"
'Billing Country:' => 'billing.address.country',
'Billing Phone Number:' => 'billing.phone',
'Billing Fax Number:' => 'billing.fax',
'Billing Email:' => 'billing.email'
);
$r['regrinfo'] = generic_parser_b($data_str['rawdata'], $items);

View file

@ -37,8 +37,7 @@ class pl_handler
$items = array(
'owner' => 'SUBSCRIBERS CONTACT OBJECT:',
'domain' => 'DOMAIN OBJECT:',
'tech' => 'Technical Contact:',
'x' => 'nservers:'
'tech' => 'Technical Contact:'
);
$fields = array (
@ -79,6 +78,7 @@ class pl_handler
}
// Get name servers
$found = false;
$ns = array();

View file

@ -53,7 +53,8 @@ class uk_handler
'domain.expires' => 'Renewal date:',
'domain.nserver' => 'Name servers:',
'domain.sponsor' => "Registrant's agent:",
'domain.status' => 'Registration status:'
'domain.status' => 'Registration status:',
'' => 'WHOIS lookup made at'
);
$r['regrinfo'] = get_blocks($data_str['rawdata'], $items);

View file

@ -43,7 +43,7 @@ domaindiscover buydomains.com
dotregistrar dotregistrar.com
dotster dotster.com namesdirect.com
encirca nic.jobs
enom enom.com adultlaw.com alabanza.com
enom enom.com
godaddy godaddy.com
iana example.com
interdomain interdominio.com

View file

@ -171,12 +171,21 @@ foreach($array1 as $key => $value)
}
}
}
elseif(!isset($array2[$key]) || $array2[$key] != $value)
else
if (!isset($array2[$key]) || $array2[$key] != $value)
{
$difference[$key] = array( 'previous' => $array2[$key], 'actual' => $value);
}
}
// Search missing items
foreach($array2 as $key => $value)
{
if (!isset($array1[$key]))
$difference[$key] = array( 'previous' => $value, 'actual' => '(missing)');
}
return !isset($difference) ? false : $difference;
}

File diff suppressed because one or more lines are too long

View file

@ -59,8 +59,10 @@ class es_handler
'organizaci&oacute;n:' => 'organization',
'direcci&oacute;n:' => 'address.street',
'poblaci&oacute;n:' => 'address.city',
'c&oacute;digo Postal:' => 'address.pcode',
'pa&iacute;s:' => 'address.country'
'c&oacute;digo postal:' => 'address.pcode',
'pa&iacute;s:' => 'address.country',
'tel&eacute;fono:' => 'phone',
'provincia:' => ''
);
array_shift($data_str['rawdata']);

View file

@ -38,14 +38,14 @@ class domaincontender_handler
'owner' => 'Registrant:',
'admin' => 'Administrative Contact:',
'tech' => 'Technical Contact:',
'domain.name' => 'Domain name:',
'domain.name' => 'Domain Name:',
'domain.nserver.' => 'Domain servers in listed order:',
'domain.created' => 'Record created on',
'domain.expires' => 'Record expires on',
'domain.changed' => 'Record last updated'
);
$r = get_blocks($data_str, $items);
$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']);

View file

@ -29,8 +29,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* dotregistrar.whois 2.0 David Saez Padros <david@ols.es> */
/* You can check it with zeleste.com */
if (!defined("__DOTREGISTRAR_HANDLER__"))
define("__DOTREGISTRAR_HANDLER__", 1);
if (!defined('__DOTREGISTRAR_HANDLER__'))
define('__DOTREGISTRAR_HANDLER__', 1);
require_once('whois.parser.php');
@ -41,24 +41,24 @@ class dotregistrar_handler
{
$items = array(
"owner" => "Registrant:",
"admin" => "Administrative Contact",
"tech" => "Technical Contact",
"zone" => "Zone Contact",
"domain.name" => "Domain name:",
"domain.nserver." => "Name Server:",
"domain.created" => "Record created on",
"domain.expires" => "Record expires on",
"domain.changed" => "Record last updated on",
"domain.status" => "Status:",
"domain.name" => "Domain Name:"
'owner' => 'Registrant:',
'admin' => 'Administrative Contact',
'tech' => 'Technical Contact',
'zone' => 'Zone Contact',
'domain.name' => 'Domain name:',
'domain.nserver.' => 'Name Server:',
'domain.created' => 'Record created on',
'domain.expires' => 'Record expires on',
'domain.changed' => 'Record last updated on',
'domain.status' => 'Status:',
'domain.name' => 'Domain Name:'
);
$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["zone"] = get_contact($r["zone"]);
$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['zone'] = get_contact($r['zone']);
format_dates($r, 'dmy');
return ($r);

View file

@ -48,11 +48,11 @@ class stargateinc_handler
'domain.status' => 'Status:'
);
$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']);
$r = get_blocks($data_str, $items,true);
$r['owner'] = get_contact($r['owner'],false,true);
$r['admin'] = get_contact($r['admin'],false,true);
$r['tech'] = get_contact($r['tech'],false,true);
$r['billing'] = get_contact($r['billing'],false,true);
$r = format_dates($r, 'dmy');
return ($r);
}

View file

@ -27,8 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* zanic.whois 1.0 Brett Cave, based on code by David Saez */
if (!defined("__ZA_HANDLER__"))
define("__ZA_HANDLER__", 1);
if (!defined('__ZA_HANDLER__'))
define('__ZA_HANDLER__', 1);
require_once('whois.parser.php');
@ -46,7 +46,8 @@ class za_handler
'admin' => 'Administrative Contact :',
'tech' => 'Technical Contact :',
'domain.nserver' => 'Domain Name Servers listed in order:',
'registered' => 'No such domain: '
'registered' => 'No such domain: ',
'' => 'The ZA NiC whois'
);
// Arrange contacts ...
@ -69,8 +70,6 @@ class za_handler
$rawdata[] = $line;
}
$r['rawdata'] = $rawdata;
$r['regrinfo'] = get_blocks($rawdata, $items);
if (isset($r['regrinfo']['registered']))
@ -85,9 +84,8 @@ class za_handler
$r['regyinfo']['referrer'] = 'http://www.za.net/'; // or http://www.za.org
$r['regyinfo']['registrar'] = 'ZA NiC';
$r = format_dates($r, 'xmdxxy');
return ($r);
}
}