NAME

WWW::eNom::Role::Command::Domain::Availability - Domain Availability Related Operations

SYNOPSIS

use WWW::eNom;

my $eNom = WWW::eNom->new( ... );

# Check If Domains Are Available
my $domain_availabilities = $eNom->check_domain_availability(
    slds => [qw( cpan drzigman brainstormincubator )],
    tlds => [qw( com net org )],
    suggestions => 0,
);

for my $domain_availability (@{ $domain_availabilities }) {
    if( $domain_availability->is_available ) {
        print 'Domain ' . $domain_availability->name . " is available!\n";
    }
    else {
        print 'Domain ' . $domain_availability->name . " is not available.\n";
    }
}

# Get Domain Suggestions
my $domain_availabilities = $eNom->suggest_domain_names(
    phrase      => 'fast race cars',
    tlds        => [qw( com net tv cc )],
    related     => 1,  # Optional, Defaults to 0
    num_results => 10, # Optional, Defaults to 10
);

for my $domain_availability (@{ $domain_availabilities }) {
    if( $domain_availability->is_available ) {
        print 'Domain ' . $domain_availability->name . " is available!\n";
    }
    else {
        print 'Domain ' . $domain_availability->name . " is not available.\n";
    }
}

REQUIRES

submit

DESCRIPTION

Implements domain availability related operations with the eNom's API.

METHODS

check_domain_availability

use WWW::eNom;

my $eNom = WWW::eNom->new( ... );

# Check If Domains Are Available
my $domain_availabilities = $eNom->check_domain_availability(
    slds => [qw( cpan drzigman brainstormincubator )],
    tlds => [qw( com net org )],
    suggestions => 0,
);

for my $domain_availability (@{ $domain_availabilities }) {
    if( $domain_availability->is_available ) {
        print 'Domain ' . $domain_availability->name . " is available!\n";
    }
    else {
        print 'Domain ' . $domain_availability->name . " is not available.\n";
    }
}

Abstraction of the Check eNom API Call. Given an ArrayRef of slds and tlds returns an ArrayRef of WWW::eNom::DomainAvailability objects. Optionally takes suggestions params (defaults to false), if specified then additional domain suggestions will be returned using the slds (one at a time) as the search phrase.

NOTE There is a hard limit of 30 "checks" for a given combination of SLDs and TLDs (excluding suggestions), if the cartesian product of the SLDs and TLDs provided is greater than 30 this method will croak with the error 'The combination of slds and tlds you provided would require more than 30 checks. Please reduce your search.'

suggest_domain_names

use WWW::eNom;

my $eNom = WWW::eNom->new( ... );

my $domain_availabilities = $eNom->suggest_domain_names(
    phrase      => 'fast race cars',
    tlds        => [qw( com net tv cc )],
    related     => 1,  # Optional, Defaults to 0
    num_results => 10, # Optional, Defaults to 10
);

for my $domain_availability (@{ $domain_availabilities }) {
    if( $domain_availability->is_available ) {
        print 'Domain ' . $domain_availability->name . " is available!\n";
    }
    else {
        print 'Domain ' . $domain_availability->name . " is not available.\n";
    }
}

Abstraction of the NameSpinner eNom API Call.

Accepts the following arguments:

phrase

A search phrase to be used for domain suggestions

tlds

ArrayRef of Public Suffixes to return domains for.

NOTE eNom will only generated suggestions for com, net, tv, cc. No matter what TLDs are provided, only suggestions for these will provided. If you do not include one of these TLDs, you will get no domain suggestion results.

Default false, if true will include related domains based on related keyboard (if you specify 'fast' you may get results with 'quick', 'instant' and 'hurry').

num_results

Default 10, number of results to return per provided (and supported) TLD.

Return an ArrayRef of WWW::eNom::DomainAvailability objects.