# HG changeset patch # User Heiko Schlittermann (JUMPER) # Date 1419240286 -3600 # Node ID e108c8bfb2376cb649b613a685fd5057f617148f # Parent 845bf6de0c4c7d086490e2e2677249aba6e625ba renamed the bin tool to joker-query Joker-whois will be another tool using another protocol. diff -r 845bf6de0c4c -r e108c8bfb237 MANIFEST --- a/MANIFEST Sun Dec 21 18:11:18 2014 +0100 +++ b/MANIFEST Mon Dec 22 10:24:46 2014 +0100 @@ -1,5 +1,5 @@ .hgignore -bin/joker-whois +bin/joker-query Build.PL doc/DMAPI-ext.txt joker diff -r 845bf6de0c4c -r e108c8bfb237 bin/joker-query --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/joker-query Mon Dec 22 10:24:46 2014 +0100 @@ -0,0 +1,37 @@ +#! /usr/bin/perl + +use 5.010; +use strict; +use warnings; +use Smart::Comments; +use Joker; + +my %conf = do 'joker.conf'; + +my $joker = Joker->new( + username => $conf{username}, + password => $conf{password}, +); + +my $x = $joker->request('query-whois', domain => shift); +say $x->code, ':', $x->status; +if ($x->code == 0) { + my %result = %{ $x->data }; + foreach (sort keys %result) { + say "$_: $result{$_}"; + } +} + +exit 0; + +### $x + +__END__ + +#say $joker->request('query-domain-list'); +my @results = map { (split)[1] } grep { /^\d/ } split /\r?\n/, + $joker->request('result-list', status => 'nack'); + +foreach (@results) { ### deleting: [===| ] [%] + $joker->request('result-delete', 'svtrid' => $_); +} diff -r 845bf6de0c4c -r e108c8bfb237 bin/joker-whois --- a/bin/joker-whois Sun Dec 21 18:11:18 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -#! /usr/bin/perl - -use 5.010; -use strict; -use warnings; -use Smart::Comments; -use Joker; - -my %conf = do 'joker.conf'; - -my $joker = Joker->new( - username => $conf{username}, - password => $conf{password}, -); - -my $x = $joker->request('query-whois', domain => shift); -say $x->code, ':', $x->status; -if ($x->code == 0) { - my %result = %{ $x->data }; - foreach (sort keys %result) { - say "$_: $result{$_}"; - } -} - -exit 0; - -### $x - -__END__ - -#say $joker->request('query-domain-list'); -my @results = map { (split)[1] } grep { /^\d/ } split /\r?\n/, - $joker->request('result-list', status => 'nack'); - -foreach (@results) { ### deleting: [===| ] [%] - $joker->request('result-delete', 'svtrid' => $_); -} diff -r 845bf6de0c4c -r e108c8bfb237 joker --- a/joker Sun Dec 21 18:11:18 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -#! /usr/bin/perl - -use 5.010; -use strict; -use warnings; -use if $ENV{DEBUG} => 'Smart::Comments'; -use Data::Dumper; -use Pod::Usage; -use WWW::Domain::Registry::Joker; - -my %conf = do 'joker.conf'; - -my $joker = WWW::Domain::Registry::Joker->new( - username => $conf{username}, - password => $conf{password}, - debug => $ENV{DEBUG}, - - # dmapi_url => 'https://dmapi.ote.joker.com/request', -); - -given (+shift) { - when ('register') { - my $domain = +shift // pod2usage; - my $proc_id = $joker->do_request( - 'domain-register', - domain => $domain, - period => 12, - status => 'production', - 'owner-c' => 'CODE-1561', - 'billing-c' => 'CODE-1561', - 'admin-c' => 'CODE-1561', - 'tech-c' => 'CODE-1561', - 'ns-list' => 'pu.schlittermann.de:hh.schlittermann.de', - ); - say "ID: $proc_id" - } - when ([qw(status result)]) { - my $id = shift // ''; - my %result = $joker->result_list; - foreach (grep { - $id =~ /^\d+$/ ? $_->{procid} == $id : $_->{reqobject} =~ $id - } sort { $a->{tstamp} <=> $b->{tstamp} } values %result) - { - $_->{tstamp} =~ s/(?\d{4})(?\d\d)(?\d\d) - (?\d\d)(?\d\d)(?\d\d)\..* - /$+{y}-$+{m}-$+{d} $+{H}:$+{M}:$+{S}/x; - say "$_->{tstamp} $_->{reqtype} $_->{reqobject} $_->{status} $_->{procid} $_->{svtrid}"; - } - - } - default { - pod2usage; - } -} - -__END__ - -=head1 NAME - - joker - register a domain - -=head1 SYNOPSIS - - joker register - joker status [|] - -=head1 DESCRIPTION - -This tool registers a domain at joker. - - -=cut - - diff -r 845bf6de0c4c -r e108c8bfb237 scratch/joker --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scratch/joker Mon Dec 22 10:24:46 2014 +0100 @@ -0,0 +1,74 @@ +#! /usr/bin/perl + +use 5.010; +use strict; +use warnings; +use if $ENV{DEBUG} => 'Smart::Comments'; +use Data::Dumper; +use Pod::Usage; +use WWW::Domain::Registry::Joker; + +my %conf = do 'joker.conf'; + +my $joker = WWW::Domain::Registry::Joker->new( + username => $conf{username}, + password => $conf{password}, + debug => $ENV{DEBUG}, + + # dmapi_url => 'https://dmapi.ote.joker.com/request', +); + +given (+shift) { + when ('register') { + my $domain = +shift // pod2usage; + my $proc_id = $joker->do_request( + 'domain-register', + domain => $domain, + period => 12, + status => 'production', + 'owner-c' => 'CODE-1561', + 'billing-c' => 'CODE-1561', + 'admin-c' => 'CODE-1561', + 'tech-c' => 'CODE-1561', + 'ns-list' => 'pu.schlittermann.de:hh.schlittermann.de', + ); + say "ID: $proc_id" + } + when ([qw(status result)]) { + my $id = shift // ''; + my %result = $joker->result_list; + foreach (grep { + $id =~ /^\d+$/ ? $_->{procid} == $id : $_->{reqobject} =~ $id + } sort { $a->{tstamp} <=> $b->{tstamp} } values %result) + { + $_->{tstamp} =~ s/(?\d{4})(?\d\d)(?\d\d) + (?\d\d)(?\d\d)(?\d\d)\..* + /$+{y}-$+{m}-$+{d} $+{H}:$+{M}:$+{S}/x; + say "$_->{tstamp} $_->{reqtype} $_->{reqobject} $_->{status} $_->{procid} $_->{svtrid}"; + } + + } + default { + pod2usage; + } +} + +__END__ + +=head1 NAME + + joker - register a domain + +=head1 SYNOPSIS + + joker register + joker status [|] + +=head1 DESCRIPTION + +This tool registers a domain at joker. + + +=cut + +