# HG changeset patch # User Heiko Schlittermann (JUMPER) # Date 1407489062 -7200 # Node ID 9ffd8fa8234534c6998a760f88639f14fcd357b2 first version of online registration diff -r 000000000000 -r 9ffd8fa82345 joker --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/joker Fri Aug 08 11:11:02 2014 +0200 @@ -0,0 +1,56 @@ +#! /usr/bin/perl + +use 5.010; +use strict; +use warnings; +use if $ENV{DEBUG} => 'Smart::Comments'; +use Data::Dumper; +use WWW::Domain::Registry::Joker; + +my %conf = do 'credentials.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 ('request') { + my $domain = +shift // die "$0: need domain\n"; + 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 ('result') { + my $id = shift; + my %result = $joker->result_list; + foreach ( + map { $result{$_} } + sort { $result{$a}{tstamp} <=> $result{$b}{tstamp} } + grep { defined $id ? ($id == $_) : 1 } keys %result + ) + { + $_->{tstamp} =~ s/(?\d{4})(?\d\d)(?\d\d) + (?\d\d)(?\d\d)(?\d\d)\..* + /$+{y}-$+{m}-$+{d} $+{H}:$+{M}:$+{S}/x; + say "$_->{reqtype} $_->{tstamp} $_->{reqobject} $_->{status}"; + } + + } + default { + die "$0 [request domain|result [id]]\n" + } +} +