man WWW::CNic () - a web-based API for the CentralNic domain registry system.

NAME

WWW::CNic - a web-based API for the CentralNic domain registry system.

SYNOPSIS

        use WWW::CNic;

        my @suffixlist = qw(uk.com us.com de.com eu.com);

        my $query = WWW::CNic->new(command => 'search', 'domain' => 'example');

        $query->set(suffixlist => \@suffixlist);

        my $response = $query->execute;

        if ($response->is_error) {
                printf("Error: %s\n", $response->error);

        } else {
                foreach my $suffix(@suffixlist) {
                        if ($response->is_registered) {
                                printf("Domain %s.%s is registered to %s\n", $domain, $suffix, $response->registrant($suffix));

                        } else {
                                printf("Domain %s.%s is available for registration\n", $domain, $suffix);

                        }
                }
        }

DESCRIPTION

CWWWW::CNic provides a powerful object-oriented Perl interface to the CentralNic Toolkit system. This system provides a way for CentralNic resellers to automate all Reseller-Registry communication and provides a far more flexible and efficient solution than the combination of whois + e-mail automaton that most registries operate.

The design of CWWWW::CNic is inspired greatly by CWLWP, which is a prerequisite. Essentially, making a transaction requires building a request object, which is then executed and returns a response object. While each transaction type (search, registration, modification...) requires a different set of data to be sent by the client, all the response objects have common properties, inherited from the CWWWW::CNic::Response base class, with just a few extra methods for accessing specific information.

INSTALLATION

Installing CWWWW::CNic is as simple as:

        cd /usr/src
        wget http://toolkit.centralnic.com/dist/WWW-CNic-x.xx.tar.gz
        tar zxvf WWW-CNic-x.xx.tar.gz
        cd WWW-CNic-x.xx
        perl Makefile.PL
        make
        make install

PREREQUISITES

1
CWLWP - the WWW Library for Perl. This in turn requires CWlibnet, CWURI and CWHTML::Parser.
2
An SSL toolkit (CWCrypt::SSLeay, CWIO::Socket::SSL) for doing HTTPS transactions.
4
CWDigest::MD5 is needed for encrypting passwords.

USAGE

Consult WWW::CNic::Cookbook for detailed information on using WWW::CNic.

CONSTRUCTOR

        my $query = WWW::CNic->new( [OPTIONS] );

The constructor for this class accepts the following options:

1
CWusername - only needed for doing domain registrations and modifications. This is the User ID of your Reseller Handle.
1
CWpassword - the password for your Reseller Handle.
2
CWuse_ssl - when set to CW1, causes all transactions to take place over a Secure Sockets Layer (SSL) connection. This is highly recommended for domain registration and modification transactions, although it's probably not needed for the other commands. In order to take advantage of this you need to have either the CWCrypt::SSLeay or CWIO::Socket::SSL modules installed. More information is available in the CWlwpcook manpage.
3
CWcommand - required for every transaction. This is a scalar containing the command name. The list of allowed commands is always growing, you should consult the Toolkit website for a complete list.
4
CWdomain - only needed for domain registrations, modifications and other commands that act upon domains.
5
CWhost - allows you to use to a non-standard host. This is mainly useful for client debugging purposes.
6
CWtest - when set to CW1, this causes any domain registration and modification transactions to use the test database. Again, this is useful for testing and debugging.
7
CWkeep_alive - by default, WWW::CNic will use CWLWP::ConnCache to cache server connections. Setting CWkeep_alive to CW0 or CWundef will turn this off.

METHODS

        $query->set( NAME => VALUE );

This method allows you to set any number of parameters prior to executing the query. The specifics of what parameters are required for what type of transaction is explained in WWW::CNic::Cookbook.

        my $response = $query->execute();

This method makes the transaction and returns an instance of a CWWWW::CNic::Response child class.

COPYRIGHT

This module is (c) 2004 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.

SEE ALSO

•
http://toolkit.centralnic.com/
•
WWW::CNic::Cookbook
•
WWW::CNic::Simple