line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::Domain::Registry::VeriSign; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
100503
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
167
|
|
4
|
4
|
|
|
4
|
|
23
|
use base qw/Class::Accessor/; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
6682
|
|
5
|
4
|
|
|
4
|
|
9252
|
use warnings; |
|
4
|
|
|
|
|
15
|
|
|
4
|
|
|
|
|
124
|
|
6
|
4
|
|
|
4
|
|
20
|
use Carp; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
373
|
|
7
|
4
|
|
|
4
|
|
5053
|
use WWW::Mechanize; |
|
4
|
|
|
|
|
766610
|
|
|
4
|
|
|
|
|
2407
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw(mech)); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
3
|
|
|
3
|
1
|
39
|
my ($class, $id, $password) = @_; |
15
|
3
|
|
|
|
|
12
|
my $self = bless {}, $class; |
16
|
3
|
|
|
|
|
42
|
$self->{reg} = { |
17
|
|
|
|
|
|
|
base => 'https://nsmanager.verisign-grs.com', |
18
|
|
|
|
|
|
|
id => $id, |
19
|
|
|
|
|
|
|
password => $password, |
20
|
|
|
|
|
|
|
}; |
21
|
3
|
|
|
|
|
29
|
$self->mech(WWW::Mechanize->new); |
22
|
3
|
|
|
|
|
55555
|
$self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub login { |
26
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
27
|
0
|
|
|
|
|
0
|
$self->mech->get($self->{reg}->{base} .'/ncc/login_page.do'); |
28
|
0
|
|
|
|
|
0
|
$self->mech->submit_form( |
29
|
|
|
|
|
|
|
form_number => 1, |
30
|
|
|
|
|
|
|
fields => { |
31
|
|
|
|
|
|
|
logonname => $self->{reg}->{id}, |
32
|
|
|
|
|
|
|
logonpassword => $self->{reg}->{password}, |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
); |
35
|
0
|
|
|
|
|
0
|
$self->parse_login($self->mech->content); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub parse_login { |
39
|
1
|
|
|
1
|
0
|
7
|
my ($self, $content) = @_; |
40
|
1
|
|
|
|
|
7
|
$content =~ m/currently logged in/; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub account_view_page { |
44
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
45
|
0
|
|
|
|
|
0
|
$self->mech->get($self->{reg}->{base} .'/ncc/account_view_page.do?MENU=Accounts'); |
46
|
0
|
|
|
|
|
0
|
$self->parse_account_view_page($self->mech->content); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub parse_account_view_page { |
50
|
2
|
|
|
2
|
0
|
16
|
my ($self, $content) = @_; |
51
|
2
|
|
|
|
|
5
|
my $content_from = qq( ); |
52
|
2
|
|
|
|
|
6
|
my $content_till = qq(); |
53
|
2
|
50
|
|
|
|
106
|
return unless $content =~ /$content_from(.*?)$content_till/s;; |
54
|
2
|
|
|
|
|
17
|
$content = $1; |
55
|
2
|
|
|
|
|
4
|
my $data; |
56
|
2
|
|
|
|
|
25
|
while ($content =~ m{ | ]*>([^:]+): | \n\s+]*>([^<]+) | \n}ig) {
57
|
28
|
|
|
|
|
69
|
my($key, $val) = ($1, $2); |
58
|
28
|
|
|
|
|
45
|
$val =~ s/ ?/ /g; |
59
|
28
|
|
|
|
|
50
|
$val =~ s/^\s+//; |
60
|
28
|
|
|
|
|
45
|
$val =~ s/\s+$//; |
61
|
28
|
|
|
|
|
32
|
$val =~ s/\n+/\n/g; |
62
|
28
|
50
|
|
|
|
266
|
$data->{lc($key)} = $val =~ m/\n/ ? [ split m/\n/ , $val ] : $val; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
2
|
|
|
|
|
9
|
return $data; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub credit_balance_view_page { |
69
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
70
|
0
|
|
|
|
|
|
$self->mech->get($self->{reg}->{base} .'/ncc/credit_balance_view_page.do?MENU=Finance'); |
71
|
0
|
|
|
|
|
|
$self->parse_credit_balance_view_page($self->mech->content); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
*parse_credit_balance_view_page = \&parse_account_view_page; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
# Preloaded methods go here. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |
79
|
|
|
|
|
|
|
__END__ |