App-DDNS-Namecheap
view release on metacpan or search on metacpan
lib/App/DDNS/Namecheap.pm view on Meta::CPAN
$App::DDNS::Namecheap::VERSION = '0.014';
}
use Moose;
use LWP::Simple qw($ua get);
$ua->agent("");
use Mozilla::CA;
has domain => ( is => 'ro', isa => 'Str', required => 1 );
has password => ( is => 'ro', isa => 'Str', required => 1 );
has hosts => ( is => 'ro', isa => 'ArrayRef', required => 1 );
has ip => ( is => 'ro', isa => 'Str', required => 0 );
sub update {
my $self = shift;
foreach ( @{ $self->{hosts} } ) {
my $url = "https://dynamicdns.park-your-domain.com/update?domain=$self->{domain}&password=$self->{password}&host=$_";
$url .= "&ip=$self->{ip}" if $self->{ip};
if ( my $return = get($url) ) {
unless ( $return =~ /<errcount>0<\/errcount>/is ) {
$return = ( $return =~ /<responsestring>(.*)<\/responsestring>/is ? $1 : "unknown error" );
( run in 0.245 second using v1.01-cache-2.11-cpan-eab888a1d7d )