ParseWhois/Domain/Registrar/DomainBank.pm untested

filter: Statementstmt 0.0% 0 / 41 Branchbran 0.0% 0 / 14 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 12 totaltotal 0.0% 0 / 81 CC 8 SCAR 33.6
CC
8
Cov
0%
parse_text
72.0
rdebug
2.0
regex_org_start
2.0
CRAP 28.7
1 # Updated on 11/21/05 by Jeff Mercer <riffer@vaxer.net>
2 #
3 package Net::ParseWhois::Domain::Registrar::DomainBank;
4  
5 require 5.004;
6 use strict;
7  
8 # TODO:
9 # this one needs work on parse_contacts .. try domainbank.net and domainbank.com.
10 # bleh.
11  
12 @Net::ParseWhois::Domain::Registrar::DomainBank::ISA = qw(Net::ParseWhois::Domain::Registrar);
13 $Net::ParseWhois::Domain::Registrar::DomainBank::VERSION = 0.2;
14  
15 sub rdebug { 0 }
16 sub regex_org_start { '^Registrant:'}
17 sub regex_no_match { '^No Match for \"' }
18 sub regex_created { '^Created on: (.*)$' }
19 sub regex_expires { '^Expires on: (.*)$' }
20 sub regex_updated { '^Last Updated on: (.*)$' }
21 sub regex_domain { '^Domain Name: (.*)$' }
22 sub regex_nameservers { '^Domain servers in listed order:$' }
23 # Doesn't seem to offer Zone contacts anymore. --jcm, 11/18/05
24 sub my_contacts { [ qw(Administrative Technical) ] }
25 # Nope, not needed anymore. --jcm, 11/18/05
26 #sub my_contacts_extra_line { 1 }
27 sub my_nameservers_noips { 1 }
28 sub my_data { [ qw(my_contacts my_nameservers_noips regex_org_start regex_no_match regex_created regex_expires regex_updated regex_domain regex_nameservers) ] }
29  
30 sub parse_text {
31 my $self = shift;
32 my $text = shift; # array ref, one line per element
33  
34 # Re-render output to make Contacts section format like NetSol type
35 # (Only relevant for contacts that have multiple roles)
36 # --jcm, 11/21/05
37 my $atext = join("\n",@{ $text });
38 $atext =~ s/Administrative, Technical Contact:/Administrative Contact, Technical Contact:/g;
39 $atext =~ s/Technical, Administrative Contact:/Administrative Contact, Technical Contact:/g;
40 my @newtext = split(/\n/, $atext);
41 $text = \@newtext;
42  
43 $self->dump_text($text) if $self->rdebug;
44 $self->parse_start($text);
45 $self->dump_text($text) if $self->rdebug;
46 $self->parse_org($text);
47 $self->dump_text($text) if $self->rdebug;
48 $self->parse_domain_name($text);
49 $self->dump_text($text) if $self->rdebug;
50 $self->parse_domain_stats($text);
51 $self->dump_text($text) if $self->rdebug;
52 $self->parse_contacts($text);
53 $self->dump_text($text) if $self->rdebug;
54 $self->parse_nameservers($text);
55 $self->dump_text($text) if $self->rdebug;
56  
57 return $self;
58 }
59  
60 # Shouldn't need this anymore. --jcm, 11/18/05
61 #sub parse_domain_stats {
62 #
63 ## required because they don't have UPDATED info .. changing base class would
64 ## be complicated, and I think ICANN requires the updated: string in whois output.
65 ## --aai
66 #
67 # my ($self, $text) = @_;
68 # while (@{ $text}) {
69 # last if ($self->{RECORD_CREATED} && $self->{RECORD_EXPIRES});
70 # my $t = shift(@{ $text });
71 # next if $t=~ /^$/;
72 # if ($t =~ /$self->{'regex_created'}/) {
73 # $self->{RECORD_CREATED} = $1;
74 # } elsif ($t =~ /$self->{'regex_expires'}/) {
75 # $self->{RECORD_EXPIRES} = $1;
76 # }
77 # }
78 #}
79  
80  
81 1;