| 1 | # Net::ParseWhois registrar parser driver | ||
| 2 | # | ||
| 3 | # Registrar: Internet Names | ||
| 4 | # Version: 0.12 | ||
| 5 | # Contributor: Adam Stubbs <astubbs@advantagecommunication.com> | ||
| 6 | # Date: 04/14/2001 | ||
| 7 | # Updated: 11/18/2005 by Jeff Mercer <jcm@vaxer.net> | ||
| 8 | # | ||
| 9 | |||
| 10 | package Net::ParseWhois::Domain::Registrar::INameWW; | ||
| 11 | |||
| 12 | require 5.004; | ||
| 13 | use strict; | ||
| 14 | |||
| 15 | @Net::ParseWhois::Domain::Registrar::INameWW::ISA = qw(Net::ParseWhois::Domain::Registrar); | ||
| 16 | $Net::ParseWhois::Domain::Registrar::INameWW::VERSION = 0.1; | ||
| 17 | |||
| 18 | sub rdebug { 0 } | ||
| 19 | sub regex_org_start { '^Registrant:'} | ||
| 20 | sub regex_no_match { '^No match for' } | ||
| 21 | sub regex_created { '^Record created on (.*).$' } | ||
| 22 | sub regex_expires { '^Record expires on (.*).$' } | ||
| 23 | sub regex_updated { '^Record last updated on (.*).$' } | ||
| 24 | sub regex_domain { '^Domain Name: (.*)$' } | ||
| 25 | sub regex_nameservers { '^Domain servers in listed order:$' } | ||
| 26 | sub my_contacts { [ qw(Administrative Technical Billing) ] } | ||
| 27 | sub my_nameservers_noips { 1 } | ||
| 28 | sub my_data { [ qw(my_contacts regex_org_start regex_no_match regex_created regex_expires regex_updated regex_domain regex_nameservers my_nameservers_noips) ] } | ||
| 29 | |||
| 30 | sub parse_text { | ||
| 31 | my $self = shift; | ||
| 32 | my $text = shift; # array ref, one line per element | ||
| 33 | my %data = (); | ||
| 34 | |||
| 35 | foreach my $line (@{$text}){ | ||
| 36 | $line .= "\n"; | ||
| 37 | if($line =~ /^(.*?)\.+\s(.*?)\n/){ | ||
| 38 | #if ($1 eq 'Name Server') { | ||
| 39 | # push(@{$data{$1}}, $2 . 'n/a'); # kludge so that t/whois.pl's map won't complain. | ||
| 40 | #} else { | ||
| 41 | push(@{$data{$1}}, $2); | ||
| 42 | #} | ||
| 43 | } | ||
| 44 | } | ||
| 45 | |||
| 46 | my $country = $data{'Organisation Address'}[-1]; | ||
| 47 | |||
| 48 | foreach my $k (keys %data){ | ||
| 49 | if(ref($data{$k}) eq 'ARRAY'){ | ||
| 50 | $data{$k} = join("\n", @{$data{$k}}); | ||
| 51 | } | ||
| 52 | } | ||
| 53 | |||
| 54 | my $newtext = qq~Registrant: | ||
| 55 | $data{'Organisation Name'} | ||
| 56 | $data{'Organisation Address'} | ||
| 57 | |||
| 58 | Domain Name: $data{'Domain Name'} | ||
| 59 | |||
| 60 | Administrative Contact, Billing Contact: | ||
| 61 | $data{'Admin Name'} $data{'Admin Email'} | ||
| 62 | $data{'Admin Address'} | ||
| 63 | Phone: $data{'Admin Phone'} | ||
| 64 | Fax: $data{'Admin Fax'} | ||
| 65 | Technical Contact: | ||
| 66 | $data{'Tech Name'} $data{'Tech Email'} | ||
| 67 | $data{'Tech Address'} | ||
| 68 | Phone: $data{'Tech Phone'} | ||
| 69 | Fax: $data{'Tech Fax'} | ||
| 70 | |||
| 71 | Record expires on $data{'Expiry Date'}. | ||
| 72 | Record created on $data{'Creation Date'}. | ||
| 73 | |||
| 74 | Domain servers in listed order: | ||
| 75 | |||
| 76 | $data{'Name Server'} | ||
| 77 | |||
| 78 | ~; | ||
| 79 | |||
| 80 | my @newtext = split(/\n/, $newtext); | ||
| 81 | $text = \@newtext; | ||
| 82 | |||
| 83 | $self->dump_text($text) if $self->rdebug; | ||
| 84 | |||
| 85 | $self->{RECORD_UPDATED} = 'n/a'; | ||
| 86 | |||
| 87 | $self->parse_start($text); | ||
| 88 | $self->parse_org($text); | ||
| 89 | $self->parse_domain_name($text); | ||
| 90 | $self->parse_contacts($text); | ||
| 91 | $self->parse_domain_stats($text); | ||
| 92 | $self->parse_nameservers($text); | ||
| 93 | |||
| 94 | |||
| 95 | $self->{COUNTRY} = $country; | ||
| 96 | return $self; | ||
| 97 | } | ||
| 98 | |||
| 99 | 1; |