| 1 | # Program: Net::ParseWhois::Domain::Registrar class for NameJuice | ||
| 2 | # Version: 1.0 | ||
| 3 | # Purpose: Parsing methods and configuration for the NameJuice Registrar | ||
| 4 | # Written: 11/28/05 by Jeff Mercer <riffer@vaxer.net> | ||
| 5 | |||
| 6 | package Net::ParseWhois::Domain::Registrar::NameJuice; | ||
| 7 | |||
| 8 | require 5.004; | ||
| 9 | use strict; | ||
| 10 | |||
| 11 | @Net::ParseWhois::Domain::Registrar::NameJuice::ISA = qw(Net::ParseWhois::Domain::Registrar); | ||
| 12 | $Net::ParseWhois::Domain::Registrar::NameJuice::VERSION = 1.0; | ||
| 13 | |||
| 14 | sub rdebug { 0 } | ||
| 15 | sub regex_org_start { '^Registrant Contact:$'} | ||
| 16 | sub regex_no_match { '^Domain not found.$' } | ||
| 17 | sub regex_created { '^Creation date: (.*)$' } | ||
| 18 | sub regex_expires { '^Expiration date: (.*)$' } | ||
| 19 | sub regex_domain { '^Domain name: (.*)$' } | ||
| 20 | sub regex_nameservers { '^Name Servers:$' } | ||
| 21 | sub my_nameservers_noips { 1 } | ||
| 22 | sub my_contacts { [ qw(Administrative Technical) ] } | ||
| 23 | sub my_data { [ qw(my_contacts my_nameservers_noips regex_org_start regex_no_match regex_created regex_expires regex_domain regex_nameservers) ] } | ||
| 24 | |||
| 25 | sub parse_text { | ||
| 26 | my $self = shift; | ||
| 27 | my $text = shift; # array ref, one line per element | ||
| 28 | |||
| 29 | # Because NetSol doesn't give the last time a domain record was | ||
| 30 | # updated, we need to pre-fill that data value so the parse_contacts | ||
| 31 | # method won't screw-up. --jcm, 11/16/05 | ||
| 32 | $self->{RECORD_UPDATED}="n/a"; | ||
| 33 | |||
| 34 | $self->dump_text($text) if $self->rdebug; | ||
| 35 | |||
| 36 | $self->parse_domain_name($text); | ||
| 37 | $self->dump_text($text) if $self->rdebug; | ||
| 38 | |||
| 39 | $self->parse_start($text); | ||
| 40 | $self->dump_text($text) if $self->rdebug; | ||
| 41 | |||
| 42 | $self->parse_org($text); | ||
| 43 | $self->dump_text($text) if $self->rdebug; | ||
| 44 | |||
| 45 | $self->parse_contacts($text); | ||
| 46 | $self->dump_text($text) if $self->rdebug; | ||
| 47 | |||
| 48 | $self->parse_nameservers($text); | ||
| 49 | $self->dump_text($text) if $self->rdebug; | ||
| 50 | |||
| 51 | $self->parse_domain_stats($text); | ||
| 52 | $self->dump_text($text) if $self->rdebug; | ||
| 53 | |||
| 54 | return $self; | ||
| 55 | } | ||
| 56 | |||
| 57 | 1; |