function parse($data_str, $query) { $items = ['domain.name' => 'Domain Name : ', 'domain.created' => 'Record Created :', 'domain.changed' => 'Record Last Updated :', 'owner.name' => 'Registered for :', 'admin' => 'Administrative Contact :', 'tech' => 'Technical Contact :', 'domain.nserver' => 'Domain Name Servers listed in order:', 'registered' => 'No such domain: ', '' => 'The ZA NiC whois']; // Arrange contacts ... $rawdata = []; while (list($key, $line) = each($data_str['rawdata'])) { if (strpos($line, ' Contact ') !== false) { $pos = strpos($line, ':'); if ($pos !== false) { $rawdata[] = substr($line, 0, $pos + 1); $rawdata[] = trim(substr($line, $pos + 1)); continue; } } $rawdata[] = $line; } $r['regrinfo'] = \phpwhois\get_blocks($rawdata, $items); if (isset($r['regrinfo']['registered'])) { $r['regrinfo']['registered'] = 'no'; } else { if (isset($r['regrinfo']['admin'])) { $r['regrinfo']['admin'] = get_contact($r['regrinfo']['admin']); } if (isset($r['regrinfo']['tech'])) { $r['regrinfo']['tech'] = get_contact($r['regrinfo']['tech']); } } $r['regyinfo']['referrer'] = 'http://www.za.net/'; // or http://www.za.org $r['regyinfo']['registrar'] = 'ZA NiC'; \phpwhois\format_dates($r, 'xmdxxy'); return $r; }
function parse($data_str, $query) { $items = ['name' => 'Domain Name (UTF-8):', 'created' => 'Record created on', 'expires' => 'Record expires on', 'changed' => 'Record last updated on', 'status' => 'Record status:', 'handle' => 'Record ID:']; while (list($key, $val) = each($data_str['rawdata'])) { $val = trim($val); if ($val != '') { if ($val == 'Domain servers in listed order:') { while (list($key, $val) = each($data_str['rawdata'])) { $val = trim($val); if ($val == '') { break; } $r['regrinfo']['domain']['nserver'][] = $val; } break; } reset($items); while (list($field, $match) = each($items)) { if (strstr($val, $match)) { $r['regrinfo']['domain'][$field] = trim(substr($val, strlen($match))); break; } } } } if (isset($r['regrinfo']['domain'])) { $r['regrinfo']['registered'] = 'yes'; } else { $r['regrinfo']['registered'] = 'no'; } $r['regyinfo'] = ['whois' => 'whois.nic.nu', 'referrer' => 'http://www.nunames.nu', 'registrar' => '.NU Domain, Ltd']; \phpwhois\format_dates($r, 'dmy'); return $r; }
function parse($data_str, $query) { $items = ['owner' => 'Contact Type: registrant', 'admin' => 'Contact Type: admin', 'tech' => 'Contact Type: tech', 'billing' => 'Contact Type: billing', 'domain.name' => 'Domain Name:', 'domain.handle' => 'Domain ID:', 'domain.expires' => 'Expiry Date:', 'domain.created' => 'Created:', 'domain.changed' => 'Last updated:', 'domain.status' => 'Domain Status:', 'domain.sponsor' => 'Sponsoring registrar:', 'domain.nserver.' => 'Host Name:']; $translate = ['Contact ID:' => 'handle', 'Name:' => 'name', 'Organisation:' => 'organization', 'Street 1:' => 'address.street.0', 'Street 2:' => 'address.street.1', 'Street 3:' => 'address.street.2', 'City:' => 'address.city', 'State/Province:' => 'address.state', 'Postal code:' => 'address.pcode', 'Country:' => 'address.country', 'Voice:' => 'phone', 'Fax:' => 'fax', 'Email:' => 'email']; $blocks = \phpwhois\get_blocks($data_str['rawdata'], $items); $r = []; if (isset($blocks['domain'])) { $r['regrinfo']['domain'] = \phpwhois\format_dates($blocks['domain'], 'dmy'); $r['regrinfo']['registered'] = 'yes'; if (isset($blocks['owner'])) { $r['regrinfo']['owner'] = \phpwhois\generic_parser_b($blocks['owner'], $translate, 'dmy', false); if (isset($blocks['tech'])) { $r['regrinfo']['tech'] = \phpwhois\generic_parser_b($blocks['tech'], $translate, 'dmy', false); } if (isset($blocks['admin'])) { $r['regrinfo']['admin'] = \phpwhois\generic_parser_b($blocks['admin'], $translate, 'dmy', false); } if (isset($blocks['billing'])) { $r['regrinfo']['billing'] = \phpwhois\generic_parser_b($blocks['billing'], $translate, 'dmy', false); } } else { $r['regrinfo']['owner'] = \phpwhois\generic_parser_b($data_str['rawdata'], $translate, 'dmy', false); } } else { $r['regrinfo']['registered'] = 'no'; } $r['regyinfo'] = ['referrer' => 'http://www.nic.coop', 'registrar' => '.coop registry']; return $r; }
function parse($data, $query) { $items = ['domain.name' => 'Domain name:', 'domain.status' => 'Status:', 'domain.nserver' => 'Domain nameservers:', 'domain.created' => 'Date registered:', 'domain.changed' => 'Record last updated:', 'domain.sponsor' => 'Registrar:', 'admin' => 'Administrative contact:', 'tech' => 'Technical contact(s):']; $r['regrinfo'] = \phpwhois\get_blocks($data['rawdata'], $items); $r['regyinfo']['referrer'] = 'http://www.domain-registry.nl'; $r['regyinfo']['registrar'] = 'Stichting Internet Domeinregistratie NL'; if (!isset($r['regrinfo']['domain']['status'])) { $r['regrinfo']['registered'] = 'no'; return $r; } if (isset($r['regrinfo']['tech'])) { $r['regrinfo']['tech'] = $this->get_contact($r['regrinfo']['tech']); } if (isset($r['regrinfo']['zone'])) { $r['regrinfo']['zone'] = $this->get_contact($r['regrinfo']['zone']); } if (isset($r['regrinfo']['admin'])) { $r['regrinfo']['admin'] = $this->get_contact($r['regrinfo']['admin']); } if (isset($r['regrinfo']['owner'])) { $r['regrinfo']['owner'] = $this->get_contact($r['regrinfo']['owner']); } $r['regrinfo']['registered'] = 'yes'; \phpwhois\format_dates($r, 'dmy'); return $r; }
function parse($data_str, $query) { $translate = ['fax-no' => 'fax', 'e-mail' => 'email', 'nic-hdl' => 'handle', 'person' => 'name', 'country' => 'address', 'netname' => 'name', 'descr' => 'desc', 'aut-num' => 'handle', 'country' => 'country']; $contacts = ['admin-c' => 'admin', 'tech-c' => 'tech']; $blocks = \phpwhois\generic_parser_a_blocks($data_str, $translate, $disclaimer); if (isset($disclaimer) && is_array($disclaimer)) { $r['disclaimer'] = $disclaimer; } if (empty($blocks) || !is_array($blocks['main'])) { $r['registered'] = 'no'; } else { if (isset($blocks[$query])) { $as = true; $rb = $blocks[$query]; } else { $rb = $blocks['main']; $as = false; } $r['registered'] = 'yes'; while (list($key, $val) = each($contacts)) { if (isset($rb[$key])) { if (is_array($rb[$key])) { $blk = $rb[$key][count($rb[$key]) - 1]; } else { $blk = $rb[$key]; } //$blk = strtoupper(strtok($blk,' ')); if (isset($blocks[$blk])) { $r[$val] = $blocks[$blk]; } unset($rb[$key]); } } $r['network'] = $rb; \phpwhois\format_dates($r, 'Ymd'); if (isset($r['network']['desc'])) { if (is_array($r['network']['desc'])) { $r['owner']['organization'] = array_shift($r['network']['desc']); $r['owner']['address'] = $r['network']['desc']; } else { $r['owner']['organization'] = $r['network']['desc']; } unset($r['network']['desc']); } if (isset($r['network']['address'])) { if (isset($r['owner']['address'])) { $r['owner']['address'][] = $r['network']['address']; } else { $r['owner']['address'] = $r['network']['address']; } unset($r['network']['address']); } } $r = ['regrinfo' => $r]; $r['regyinfo']['type'] = 'ip'; $r['regyinfo']['registrar'] = 'Asia Pacific Network Information Centre'; return $r; }
function parse($data_str, $query) { $items = ['owner.name' => 'Registrant Name:', 'owner.organization' => 'Registrant Organization:', 'owner.address.street' => 'Registrant Street:', 'owner.address.city' => 'Registrant City:', 'owner.address.state' => 'Registrant State/Province:', 'owner.address.pcode' => 'Registrant Postal Code:', 'owner.address.country' => 'Registrant Country:', 'owner.phone' => 'Registrant Phone:', 'owner.fax' => 'Registrant Fax:', 'owner.email' => 'Registrant Email:', 'admin.name' => 'Admin Name:', 'admin.organization' => 'Admin Organization:', 'admin.address.street' => 'Admin Street:', 'admin.address.city' => 'Admin City:', 'admin.address.state' => 'Admin State/Province:', 'admin.address.pcode' => 'Admin Postal Code:', 'admin.address.country' => 'Admin Country:', 'admin.phone' => 'Admin Phone:', 'admin.fax' => 'Admin Fax:', 'admin.email' => 'Admin Email:', 'tech.name' => 'Tech Name:', 'tech.organization' => 'Tech Organization:', 'tech.address.street' => 'Tech Street:', 'tech.address.city' => 'Tech City:', 'tech.address.state' => 'Tech State/Province:', 'tech.address.pcode' => 'Tech Postal Code:', 'tech.address.country' => 'Tech Country:', 'tech.phone' => 'Tech Phone:', 'tech.fax' => 'Tech Fax:', 'tech.email' => 'Tech Email:', 'domain.name' => 'Domain Name:', 'domain.sponsor' => 'Reseller:', 'domain.nserver' => 'Name Server:', 'domain.created' => 'Creation Date:', 'domain.expires' => 'Registrar Registration Expiration Date:', 'domain.changed' => 'Updated Date:', 'domain.dnssrc' => 'DNSSRC:']; //return easy_parser($data_str, $items, 'dmy', false, false, true); $r = \phpwhois\get_blocks($data_str, $items, false, false); \phpwhois\format_dates($r, 'dmy'); $this->_strlower($r); return $r; }
function parse($data_str, $query) { $items = ['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 = \phpwhois\get_blocks($data_str, $items); $r['owner'] = get_contact($r['owner']); $r['admin'] = get_contact($r['admin'], false, true); $r['tech'] = get_contact($r['tech'], false, true); return \phpwhois\format_dates($r, 'dmy'); }
function parse($data_str, $query) { $items = ['owner' => 'Holder Contact', 'admin' => 'Admin Contact', 'tech' => 'Tech. Contact', 'domain.nserver.' => 'Nameservers', 'domain.created' => 'Creation Date:', 'domain.expires' => 'Expiration Date:']; $translate = ['city:' => 'address.city', 'org. name:' => 'organization', 'address1:' => 'address.street.', 'address2:' => 'address.street.', 'state:' => 'address.state', 'postal code:' => 'address.zip']; $r = \phpwhois\get_blocks($data_str, $items, true); $r['owner'] = get_contact($r['owner'], $translate); $r['admin'] = get_contact($r['admin'], $translate, true); $r['tech'] = get_contact($r['tech'], $translate, true); return \phpwhois\format_dates($r, 'dmy'); }
function parse($data_str, $query) { $items = ['owner.name' => 'Registrant Name:', 'owner.organization' => 'Registrant Organization:', 'owner.address.street' => 'Registrant Street:', 'owner.address.city' => 'Registrant City:', 'owner.address.state' => 'Registrant State/Province:', 'owner.address.pcode' => 'Registrant Postal Code:', 'owner.address.country' => 'Registrant Country:', 'owner.phone' => 'Registrant Phone:', 'owner.fax' => 'Registrant Fax:', 'owner.email' => 'Registrant Email:', 'admin.name' => 'Admin Name:', 'admin.organization' => 'Admin Organization:', 'admin.address.street' => 'Admin Street:', 'admin.address.city' => 'Admin City:', 'admin.address.state' => 'Admin State/Province:', 'admin.address.pcode' => 'Admin Postal Code:', 'admin.address.country' => 'Admin Country:', 'admin.phone' => 'Admin Phone:', 'admin.fax' => 'Admin Fax:', 'admin.email' => 'Admin Email:', 'tech.name' => 'Tech Name:', 'tech.organization' => 'Tech Organization:', 'tech.address.street' => 'Tech Street:', 'tech.address.city' => 'Tech City:', 'tech.address.state' => 'Tech State/Province:', 'tech.address.pcode' => 'Tech Postal Code:', 'tech.address.country' => 'Tech Country:', 'tech.phone' => 'Tech Phone:', 'tech.fax' => 'Tech Fax:', 'tech.email' => 'Tech Email:', 'domain.name' => 'Domain Name:', 'domain.sponsor' => 'Registrar Name:', 'domain.nserver' => 'Domain servers in listed order:', 'domain.created' => 'Created on..............:', 'domain.expires' => 'Expires on..............:', 'domain.changed' => 'Record last updated on..:']; //$r = easy_parser($data_str, $items, 'dmy', false, false, true); $r = \phpwhois\get_blocks($data_str, $items, false, false); \phpwhois\format_dates($r, 'dmy'); if (isset($r['domain']['sponsor']) && is_array($r['domain']['sponsor'])) { $r['domain']['sponsor'] = $r['domain']['sponsor'][0]; } return $r; }
function parse($data_str, $query) { $blocks = ['owner1' => '[ Organization Information ]', 'tech1' => '[ Technical Contact Information ]', 'owner2' => '[ ISP Organization Information ]', 'admin2' => '[ ISP IP Admin Contact Information ]', 'tech2' => '[ ISP IP Tech Contact Information ]', 'admin3' => '[ ISP IPv4 Admin Contact Information ]', 'tech3' => '[ ISP IPv4 Tech Contact Information ]', 'abuse' => '[ ISP Network Abuse Contact Information ]', 'network.inetnum' => 'IPv4 Address :', 'network.name' => 'Network Name :', 'network.mnt-by' => 'Connect ISP Name :', 'network.created' => 'Registration Date :']; $items = ['Orgnization ID :' => 'handle', 'Org Name :' => 'organization', 'Org Name :' => 'organization', 'Name :' => 'name', 'Name :' => 'name', 'Org Address :' => 'address.street', 'Zip Code :' => 'address.pcode', 'State :' => 'address.state', 'Address :' => 'address.street', 'Zip Code :' => 'address.pcode', 'Phone :' => 'phone', 'Phone :' => 'phone', 'Fax :' => 'fax', 'E-Mail :' => 'email', 'E-Mail :' => 'email']; $b = \phpwhois\get_blocks($data_str, $blocks); if (isset($b['network'])) { $r['network'] = $b['network']; } if (isset($b['owner1'])) { $r['owner'] = \phpwhois\generic_parser_b($b['owner1'], $items, 'Ymd', false); } else { if (isset($b['owner2'])) { $r['owner'] = \phpwhois\generic_parser_b($b['owner2'], $items, 'Ymd', false); } } if (isset($b['admin2'])) { $r['admin'] = \phpwhois\generic_parser_b($b['admin2'], $items, 'Ymd', false); } else { if (isset($b['admin3'])) { $r['admin'] = \phpwhois\generic_parser_b($b['admin3'], $items, 'Ymd', false); } } if (isset($b['tech1'])) { $r['tech'] = \phpwhois\generic_parser_b($b['tech1'], $items, 'Ymd', false); } else { if (isset($b['tech2'])) { $r['tech'] = \phpwhois\generic_parser_b($b['tech2'], $items, 'Ymd', false); } else { if (isset($b['tech3'])) { $r['tech'] = \phpwhois\generic_parser_b($b['tech3'], $items, 'Ymd', false); } } } if (isset($b['abuse'])) { $r['abuse'] = \phpwhois\generic_parser_b($b['abuse'], $items, 'Ymd', false); } $r = \phpwhois\format_dates($r, 'Ymd'); $r = ['regrinfo' => $r]; $r['regyinfo']['type'] = 'ip'; $r['regyinfo']['registrar'] = 'Korean Network Information Centre'; return $r; }
function parse($data, $query) { $items = ['owner' => 'Registrant', 'admin' => 'Admin', 'tech' => 'Technical', 'billing' => 'Billing', 'domain.nserver' => 'Name Servers:', 'domain.created' => 'Created:', 'domain.expires' => 'Expires:', 'domain.changed' => 'Modified:', 'domain.status' => 'Status:', 'domain.sponsor' => 'Registrar Name:']; $r['regrinfo'] = \phpwhois\get_blocks($data['rawdata'], $items); $items = ['phone number:' => 'phone', 'email address:' => 'email', 'fax number:' => 'fax', 'organisation:' => 'organization']; if (!empty($r['regrinfo']['domain']['created'])) { $r['regrinfo'] = \phpwhois\get_contacts($r['regrinfo'], $items); if (count($r['regrinfo']['billing']['address']) > 4) { $r['regrinfo']['billing']['address'] = array_slice($r['regrinfo']['billing']['address'], 0, 4); } $r['regrinfo']['registered'] = 'yes'; \phpwhois\format_dates($r['regrinfo']['domain'], 'dmY'); } else { $r = ''; $r['regrinfo']['registered'] = 'no'; } $r['regyinfo']['referrer'] = 'http://www.dot.dm'; $r['regyinfo']['registrar'] = 'dotFM'; return $r; }
function parse($data_str, $query) { $items = ['owner.organization' => 'Registrant:', 'owner.address' => "Registrant's address:", 'owner.type' => 'Registrant type:', 'domain.created' => 'Registered on:', 'domain.changed' => 'Last updated:', 'domain.expires' => 'Renewal date:', 'domain.nserver' => 'Name servers:', 'domain.sponsor' => 'Registrar:', 'domain.status' => 'Registration status:', 'domain.dnssec' => 'DNSSEC:', '' => 'WHOIS lookup made at', 'disclaimer' => '--']; $r['regrinfo'] = \phpwhois\get_blocks($data_str['rawdata'], $items); if (isset($r['regrinfo']['owner'])) { $r['regrinfo']['owner']['organization'] = $r['regrinfo']['owner']['organization'][0]; $r['regrinfo']['domain']['sponsor'] = $r['regrinfo']['domain']['sponsor'][0]; $r['regrinfo']['registered'] = 'yes'; $r = \phpwhois\format_dates($r, 'dmy'); } else { if (strpos($data_str['rawdata'][1], 'Error for ')) { $r['regrinfo']['registered'] = 'yes'; $r['regrinfo']['domain']['status'] = 'invalid'; } else { $r['regrinfo']['registered'] = 'no'; } } $r['regyinfo'] = ['referrer' => 'http://www.nominet.org.uk', 'registrar' => 'Nominet UK']; return $r; }
function parse($data, $query) { $items = ['domain.name' => 'Domain:', 'domain.status' => 'Status:', 'domain.nserver' => 'Nameservers:', 'domain.created' => 'Registered:', 'owner' => 'Licensee:', 'admin' => 'Onsite Contacts:', 'tech' => 'Registrar Technical Contacts:', 'agent' => 'Registrar:', 'agent.uri' => 'Website:']; $trans = ['company name2:' => '']; $r['regrinfo'] = \phpwhois\get_blocks($data['rawdata'], $items); if ($r['regrinfo']['domain']['status'] == 'REGISTERED') { $r['regrinfo']['registered'] = 'yes'; $r['regrinfo'] = \phpwhois\get_contacts($r['regrinfo'], $trans); if (isset($r['regrinfo']['agent'])) { $sponsor = get_contact($r['regrinfo']['agent'], $trans); unset($r['regrinfo']['agent']); $r['regrinfo']['domain']['sponsor'] = $sponsor; } $r = \phpwhois\format_dates($r, '-mdy'); } else { $r['regrinfo']['registered'] = 'no'; } $r['regyinfo']['referrer'] = 'http://www.domain-registry.nl'; $r['regyinfo']['registrar'] = 'DNS Belgium'; return $r; }