line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::DDNS::Namecheap; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$App::DDNS::Namecheap::VERSION = '0.013'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
36857
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use LWP::Simple qw($ua get); |
8
|
|
|
|
|
|
|
$ua->agent(""); |
9
|
|
|
|
|
|
|
use Mozilla::CA; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has domain => ( is => 'ro', isa => 'Str', required => 1 ); |
12
|
|
|
|
|
|
|
has password => ( is => 'ro', isa => 'Str', required => 1 ); |
13
|
|
|
|
|
|
|
has hosts => ( is => 'ro', isa => 'ArrayRef', required => 1 ); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub update { |
16
|
|
|
|
|
|
|
my $self = shift; |
17
|
|
|
|
|
|
|
foreach ( @{ $self->{hosts} } ) { |
18
|
|
|
|
|
|
|
my $url = "https://dynamicdns.park-your-domain.com/update?domain=$self->{domain}&password=$self->{password}&host=$_"; |
19
|
|
|
|
|
|
|
if ( my $return = get($url) ) { |
20
|
|
|
|
|
|
|
unless ( $return =~ /<errcount>0<\/errcount>/is ) { |
21
|
|
|
|
|
|
|
$return = ( $return =~ /<responsestring>(.*)<\/responsestring>/is ? $1 : "unknown error" ); |
22
|
|
|
|
|
|
|
print "failure submitting host \"$_\.$self->{domain}\": $return\n"; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
no Moose; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 NAME |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
App::DDNS::Namecheap - Dynamic DNS update utility for Namecheap registered domains |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 VERSION |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
version 0.013 |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SYNOPSIS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
my $domain = App::DDNS::Namecheap->new( |
45
|
|
|
|
|
|
|
domain => 'mysite.org', |
46
|
|
|
|
|
|
|
password => 'abcdefghijklmnopqrstuvwxyz012345', |
47
|
|
|
|
|
|
|
hosts => [ "@", "www", "*" ], |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
$domain->update(); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 DESCRIPTION |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
This module provides a method for setting the address records of your Namecheap registered |
55
|
|
|
|
|
|
|
domains to your external IP address. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 METHODS |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=over 4 |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item B<update> |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Updates Namecheap A records using the three attributes listed above. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=back |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 AUTHOR |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
David Watson <dwatson@cpan.org> |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 SEE ALSO |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
scripts/ in the distribution |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify |
78
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
The full text of the license can be found in the LICENSE file included with this module. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=cut |