r66312 - in /branches/upstream/libwww-cnic-perl/current/lib/WWW: ./ CNic/ CNic/Response/ CNic/Response/Register/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sat Dec 25 15:06:58 UTC 2010


Author: jawnsy-guest
Date: Sat Dec 25 15:06:47 2010
New Revision: 66312

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=66312
Log:
[svn-upgrade] new version libwww-cnic-perl (0.37)

Added:
    branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/NG.pm
Removed:
    branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/Register/
Modified:
    branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic.pm
    branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/CreateHandle.pm
    branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/DomainList.pm
    branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/ListOutstandingDomains.pm
    branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/PollTransfers.pm
    branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/Search.pm
    branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/Suffixes.pm

Modified: branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic.pm?rev=66312&op=diff
==============================================================================
--- branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic.pm (original)
+++ branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic.pm Sat Dec 25 15:06:47 2010
@@ -1,7 +1,7 @@
 # Copyright (c) 2010 CentralNic Ltd. All rights reserved. This program is
 # free software; you can redistribute it and/or modify it under the same
 # terms as Perl itself.
-# $Id: CNic.pm,v 1.62 2010/05/21 16:36:47 gavin Exp $
+# $Id: CNic.pm,v 1.67 2010/06/15 16:03:57 gavin Exp $
 package WWW::CNic;
 use LWP;
 use LWP::ConnCache;
@@ -11,7 +11,7 @@
 use vars qw($VERSION $CONNECTION_CACHE);
 use strict;
 
-our $VERSION = '0.32';
+our $VERSION = '0.36';
 
 =pod
 
@@ -206,7 +206,6 @@
 		$self->{_command} eq 'handle_info'		&& return $self->_handle_info();
 		$self->{_command} eq 'register'			&& return $self->_register();
 		$self->{_command} eq 'register_idn'		&& return $self->_register(idn => 1);
-		$self->{_command} eq 'register_atgb'		&& return $self->_register_atgb();
 		$self->{_command} eq 'modify'			&& return $self->_modify();
 		$self->{_command} eq 'modify_handle'		&& return $self->_modify_handle();
 		$self->{_command} eq 'renewals'			&& return $self->_upcoming_renewals();
@@ -395,38 +394,6 @@
 	return WWW::CNic::Response::Register->new($self->{_response}->{_raw});
 }
 
-sub _register_atgb {
-	my $self = shift;
-	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL
-	die("Missing domain name") if $self->{_domain} eq '';
-	die("Missing username") if $self->{_username} eq '';
-	die("Missing password") if $self->{_password} eq '';
-	my ($fname, $sname, $suffix) = split(/\./, $self->{_domain}, 3);
-	my %params = 	(
-				user		=> $self->{_username},
-				password	=> $self->_crypt_md5($self->{_password}),
-				test		=> $self->{_test},
-				fname		=> $fname,
-				sname		=> $sname,
-				suffix		=> $suffix,
-				registrant	=> $self->{_params}->{registrant},
-				handle		=> $self->_build_handle_string($self->{_params}->{handle}),
-				user_password	=> $self->{_params}->{user_password},
-				send_email	=> $self->{_params}->{send_email}
-			);
-	my $req = HTTP::Request->new(POST => "$self->{_base}/register_atgb");
-	$req->content_type('application/x-www-form-urlencoded');
-	my @content;
-	foreach my $name(keys %params) {
-		my $pair = uri_escape($name).'='.uri_escape($params{$name});
-		push(@content, $pair);
-	}
-	$req->content(join('&', @content));
-	$self->{_response}->{_raw} = $self->_get($req);
-	use WWW::CNic::Response::Register::AtGB;
-	return WWW::CNic::Response::Register::AtGB->new($self->{_response}->{_raw});
-}
-
 sub _modify {
 	my $self = shift;
 	$self->{_base} =~ s/^http:/https:/g;	# Requires SSL

Added: branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/NG.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/NG.pm?rev=66312&op=file
==============================================================================
--- branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/NG.pm (added)
+++ branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/NG.pm Sat Dec 25 15:06:47 2010
@@ -1,0 +1,114 @@
+# $Id: NG.pm,v 1.7 2010/06/15 12:53:14 gavin Exp $
+# Copyright (c) 2010 CentralNic Ltd. This program is Free Software; you
+# can use it and/or modify it under the same terms as Perl itself.
+package WWW::CNic::NG;
+use WWW::CNic;
+use strict;
+
+our $AUTOLOAD;
+
+sub new {
+	my $package = shift(@_);
+	my $self = bless({'package' => $package}, $package);
+	foreach my $name (keys(%_)) {
+		$self->{$name} = $_{$name};
+	}
+	return $self;
+}
+
+sub AUTOLOAD {
+	my ($self, %params) = @_;
+	$AUTOLOAD =~ s/^$self->{'package'}:://g;
+	next if ($AUTOLOAD eq 'DESTROY');
+
+	my $query = WWW::CNic->new(
+		'command'	=> $AUTOLOAD,
+		'test'		=> $self->{'test'},
+		'username'	=> $self->{'username'},
+		'password'	=> $self->{'password'},
+		'domain'	=> $params{'domain'},
+	);
+	$query->set(%params);
+	return $query->execute;
+};
+
+=pod
+
+=head1 NAME
+
+WWW::CNic::NG - a next generation interface to C<WWW:CNic>.
+
+=head1 USAGE
+
+	#!/usr/bin/perl
+	use WWW::CNic::NG;
+	use strict;
+
+	my $cnic = WWW::CNic::NG->new(
+		'username'	=> 'H12345',
+		'password'	=> 'password',
+		'test'		=> 1, # run against the test database
+	);
+
+	# $response is a WWW::CNic::Response submodule:
+	my $response = $cnic->whois('domain' => 'example.uk.com');
+
+=head1 SYNOPSIS
+
+C<WWW::CNIC::NG> provides a simpler and more consistent interface to the
+C<WWW::CNIC> module. It allows you to reuse the same object for multiple
+API calls, and provides Toolkit commands as methods of the object.
+
+=head1 Executing Toolkit Commands
+
+If you have used C<WWW:CNic> you will be familiar with using it like so:
+
+	my $query = WWW::CNic->new(
+		'command'	=> 'whois',
+		'username'	=> 'H12345',
+		'password'	=> 'password',
+		'domain'	=> 'example.uk.com',
+	);
+
+	$query->set(%more_params);
+
+	# $response is a WWW::CNic::Response submodule:
+	my $response = $query->execute;
+
+This is somewhat cumbersome compared to the earlier example.
+C<WWW::CNIC::NG> serves to tidy up some of this mess.
+
+Instead of specifying the desired command as a parameter supplied to the
+constructor, you simply call the method you want to use on the
+C<WWW::CNIC::NG> object. The method's parameters are then used to
+prepare a query, and the response from the server is returned from the
+method.
+
+=head1 COPYRIGHT
+
+This module is (c) 2010 CentralNic Ltd. All rights reserved. This module
+is free software; you can redistribute it and/or modify it under the
+same terms as Perl itself.
+
+=head1 SEE ALSO
+
+=over
+
+=item *
+
+http://toolkit.centralnic.com/
+
+=item *
+
+L<WWW::CNic::Cookbook>
+
+=item *
+
+L<WWW::CNic::Simple>
+
+=back
+
+=cut
+
+1;
+

Modified: branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/CreateHandle.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/CreateHandle.pm?rev=66312&op=diff
==============================================================================
--- branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/CreateHandle.pm (original)
+++ branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/CreateHandle.pm Sat Dec 25 15:06:47 2010
@@ -1,7 +1,7 @@
 # Copyright (c) 2010 CentralNic Ltd. All rights reserved. This program is
 # free software; you can redistribute it and/or modify it under the same
 # terms as Perl itself.
-# $Id: CreateHandle.pm,v 1.7 2010/03/31 11:58:31 gavin Exp $
+# $Id: CreateHandle.pm,v 1.8 2010/06/15 10:47:31 gavin Exp $
 
 package WWW::CNic::Response::CreateHandle;
 use vars qw($VERSION);
@@ -10,7 +10,7 @@
 
 =head1 NAME
 
-WWW::CNic::Response::CreateHandle - a WWW::CNic response object for creating new handles. It is advisable to create a new handle when registering multiple domains to avoid administration problems in the future.
+WWW::CNic::Response::CreateHandle - a WWW::CNic response object for creating new handles.
 
 =head1 SYNOPSIS
 

Modified: branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/DomainList.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/DomainList.pm?rev=66312&op=diff
==============================================================================
--- branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/DomainList.pm (original)
+++ branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/DomainList.pm Sat Dec 25 15:06:47 2010
@@ -1,7 +1,7 @@
 # Copyright (c) 2010 CentralNic Ltd. All rights reserved. This program is
 # free software; you can redistribute it and/or modify it under the same
 # terms as Perl itself.
-# $Id: DomainList.pm,v 1.9 2010/03/31 11:58:31 gavin Exp $
+# $Id: DomainList.pm,v 1.10 2010/06/15 08:21:56 gavin Exp $
 
 package WWW::CNic::Response::DomainList;
 use vars qw($VERSION);
@@ -10,7 +10,7 @@
 
 =head1 NAME
 
-WWW::CNic::Response::Renewals - a WWW::CNic response object for domain lists.
+WWW::CNic::Response::DomainList - a WWW::CNic response object for domain lists.
 
 =head1 SYNOPSIS
 
@@ -89,4 +89,4 @@
 	return $stuff[0];
 }
 
-1;
+1;

Modified: branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/ListOutstandingDomains.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/ListOutstandingDomains.pm?rev=66312&op=diff
==============================================================================
--- branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/ListOutstandingDomains.pm (original)
+++ branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/ListOutstandingDomains.pm Sat Dec 25 15:06:47 2010
@@ -1,7 +1,7 @@
 # Copyright (c) 2010 CentralNic Ltd. All rights reserved. This program is
 # free software; you can redistribute it and/or modify it under the same
 # terms as Perl itself.
-# $Id: ListOutstandingDomains.pm,v 1.2 2010/03/31 11:58:31 gavin Exp $
+# $Id: ListOutstandingDomains.pm,v 1.3 2010/06/15 08:21:56 gavin Exp $
 
 package WWW::CNic::Response::ListOutstandingDomains;
 use vars qw($VERSION);
@@ -9,6 +9,8 @@
 =pod
 
 =head1 NAME
+
+WWW::CNic::Response::ListOutstandingDomains - a WWW::CNic response object for listing outstanding domains.
 
 =head1 SYNOPSIS
 

Modified: branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/PollTransfers.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/PollTransfers.pm?rev=66312&op=diff
==============================================================================
--- branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/PollTransfers.pm (original)
+++ branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/PollTransfers.pm Sat Dec 25 15:06:47 2010
@@ -1,7 +1,7 @@
 # Copyright (c) 2010 CentralNic Ltd. All rights reserved. This program is
 # free software; you can redistribute it and/or modify it under the same
 # terms as Perl itself.
-# $Id: PollTransfers.pm,v 1.3 2010/03/31 11:58:31 gavin Exp $
+# $Id: PollTransfers.pm,v 1.4 2010/06/15 08:21:56 gavin Exp $
 
 package WWW::CNic::Response::PollTransfers;
 use vars qw($VERSION);
@@ -9,6 +9,8 @@
 =pod
 
 =head1 NAME
+
+WWW::CNic::Response::PollTransfers - a WWW::CNic::Response object for WWW::CNic::Response.
 
 =head1 SYNOPSIS
 

Modified: branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/Search.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/Search.pm?rev=66312&op=diff
==============================================================================
--- branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/Search.pm (original)
+++ branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/Search.pm Sat Dec 25 15:06:47 2010
@@ -1,7 +1,7 @@
 # Copyright (c) 2010 CentralNic Ltd. All rights reserved. This program is
 # free software; you can redistribute it and/or modify it under the same
 # terms as Perl itself.
-# $Id: Search.pm,v 1.12 2010/03/31 11:58:31 gavin Exp $
+# $Id: Search.pm,v 1.13 2010/06/15 08:21:56 gavin Exp $
 
 package WWW::CNic::Response::Search;
 use vars qw($VERSION);
@@ -10,7 +10,7 @@
 
 =head1 NAME
 
-WWW::CNic::Response::Register - a WWW::CNic response object for domain searching.
+WWW::CNic::Response::Search - a WWW::CNic response object for domain searching.
 
 =head1 SYNOPSIS
 

Modified: branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/Suffixes.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/Suffixes.pm?rev=66312&op=diff
==============================================================================
--- branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/Suffixes.pm (original)
+++ branches/upstream/libwww-cnic-perl/current/lib/WWW/CNic/Response/Suffixes.pm Sat Dec 25 15:06:47 2010
@@ -1,7 +1,7 @@
 # Copyright (c) 2010 CentralNic Ltd. All rights reserved. This program is
 # free software; you can redistribute it and/or modify it under the same
 # terms as Perl itself.
-# $Id: Suffixes.pm,v 1.10 2010/03/31 11:58:31 gavin Exp $
+# $Id: Suffixes.pm,v 1.11 2010/06/15 08:21:56 gavin Exp $
 
 package WWW::CNic::Response::Suffixes;
 use vars qw($VERSION);
@@ -10,7 +10,7 @@
 
 =head1 NAME
 
-WWW::CNic::Response::Register - a WWW::CNic response object for suffix list lookup.
+WWW::CNic::Response::Suffixes - a WWW::CNic response object for suffix list lookup.
 
 =head1 SYNOPSIS
 
@@ -59,4 +59,4 @@
 
 sub suffixes { return grep { /[A-Z]{2}\.[A-Z]{3}$/i } sort(keys(%{$_[0]->{_response}})) }
 
-1;
+1;




More information about the Pkg-perl-cvs-commits mailing list