added .ly handler & other fixes
This commit is contained in:
parent
440316f836
commit
63277c69c6
7 changed files with 97 additions and 8 deletions
|
@ -1,3 +1,6 @@
|
|||
2010/04/13
|
||||
- added .ly handler
|
||||
|
||||
2009/12/29
|
||||
- released version 4.2.0
|
||||
- added handler for .tel
|
||||
|
|
|
@ -61,7 +61,6 @@ if (isSet($_GET['query']))
|
|||
// $whois->non_icann = true;
|
||||
|
||||
$result = $whois->Lookup($query);
|
||||
|
||||
$resout = str_replace('{query}', $query, $resout);
|
||||
$winfo = '';
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ class gtld_handler extends WhoisClient
|
|||
$this->Query = array();
|
||||
$this->SUBVERSION = sprintf('%s-%s', $query['handler'], $this->HANDLER_VERSION);
|
||||
$this->result = generic_parser_b($data['rawdata'], $this->REG_FIELDS, 'dmy');
|
||||
|
||||
|
||||
unset($this->result['registered']);
|
||||
|
||||
if (isset($this->result['nodomain']))
|
||||
|
@ -72,11 +72,15 @@ class gtld_handler extends WhoisClient
|
|||
$this->result['regrinfo']['registered'] = 'no';
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
|
||||
if ($this->deep_whois) $this->result = $this->DeepWhois($query,$this->result);
|
||||
|
||||
// Next server could fail to return data
|
||||
if (count($this->result['rawdata']) < 2) $this->result['rawdata'] = $data['rawdata'];
|
||||
|
||||
// Domain is registered no matter what next server says
|
||||
$this->result['regrinfo']['registered'] = 'yes';
|
||||
|
||||
if ($this->deep_whois) $this->result = $this->DeepWhois($query,$this->result);
|
||||
|
||||
return $this->result;
|
||||
}
|
||||
}
|
||||
|
|
81
src/whois.ly.php
Normal file
81
src/whois.ly.php
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
/*
|
||||
Whois.php PHP classes to conduct whois queries
|
||||
|
||||
Copyright (C)1999,2005 easyDNS Technologies Inc. & Mark Jeftovic
|
||||
|
||||
Maintained by David Saez (david@ols.es)
|
||||
|
||||
For the most recent version of this package visit:
|
||||
|
||||
http://www.phpwhois.org
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* ly.whois 1.0 Franck Martin <franck@avonsys.com> For .ly domains */
|
||||
|
||||
require_once('whois.parser.php');
|
||||
|
||||
if (!defined('__LY_HANDLER__'))
|
||||
define('__LY_HANDLER__', 1);
|
||||
|
||||
class ly_handler
|
||||
{
|
||||
|
||||
function parse($data_str, $query)
|
||||
{
|
||||
|
||||
$items = array(
|
||||
'owner' => 'Registrant:',
|
||||
'admin' => 'Administrative Contact:',
|
||||
'tech' => 'Technical Contact:',
|
||||
'domain.name' => 'Domain Name:',
|
||||
'domain.status' => 'Domain Status:',
|
||||
'domain.created' => 'Created:',
|
||||
'domain.changed' => 'Updated:',
|
||||
'domain.expires' => 'Expired:',
|
||||
'domain.nserver' => 'Domain servers in listed order:'
|
||||
);
|
||||
|
||||
$extra = array( 'zip/postal code:' => 'address.pcode' );
|
||||
|
||||
$r['regrinfo'] = get_blocks($data_str['rawdata'], $items);
|
||||
|
||||
if (!empty($r['regrinfo']['domain']['name']))
|
||||
{
|
||||
$r['regrinfo'] = get_contacts($r['regrinfo'],$extra);
|
||||
|
||||
$r['regrinfo']['domain']['name'] = $r['regrinfo']['domain']['name'][0];
|
||||
|
||||
$r['regyinfo'] = array(
|
||||
'referrer' => 'http://www.nic.ly',
|
||||
'registrar' => 'Libya ccTLD'
|
||||
);
|
||||
|
||||
$r['regrinfo']['registered'] = 'yes';
|
||||
}
|
||||
else
|
||||
{
|
||||
$r = '';
|
||||
$r['regrinfo']['registered'] = 'no';
|
||||
}
|
||||
|
||||
return ($r);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
@ -205,9 +205,9 @@ class Whois extends WhoisClient
|
|||
break;
|
||||
}
|
||||
|
||||
// Regular handler exists for the tld ?
|
||||
|
||||
// Regular handler exists for the tld ?
|
||||
if (($fp = @fopen('whois.'.$htld.'.php', 'r', 1)) and fclose($fp))
|
||||
//if (file_exists('whois.'.$htld.'.php'))
|
||||
{
|
||||
$handler = $htld;
|
||||
break;
|
||||
|
|
|
@ -82,7 +82,8 @@ $this->WHOIS_SPECIAL = array(
|
|||
'me' => 'whois.meregistry.net',
|
||||
'mobi' => 'whois.dotmobiregistry.net',
|
||||
'ms' => 'http://www.adamsnames.tc/whois/?domain={domain}.ms',
|
||||
'mt' => 'http://www.um.edu.mt/cgi-bin/nic/whois?domain={domain}.mt',
|
||||
'mt' => 'http://www.um.edu.mt/cgi-bin/nic/whois?domain={domain}.mt',
|
||||
'ly' => 'whois.nic.ly',
|
||||
'pe' => 'http://nic.pe/detpublic.php?decid=B&ndom={domain}.pe',
|
||||
'pr' => 'whois.uprr.pr',
|
||||
'pro' => 'whois.registry.pro',
|
||||
|
|
1
test.txt
1
test.txt
|
@ -22,6 +22,7 @@ it nic.it
|
|||
li nic.li
|
||||
lt domreg.lt
|
||||
lu dns.lu
|
||||
ly nic.ly
|
||||
mx nic.mx
|
||||
nl domain-registry.nl
|
||||
nu nunames.nu
|
||||
|
|
Loading…
Reference in a new issue