NAME

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

SYNOPSIS

use WWW::LogicBoxes;

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

# Check If Domains Are Available
my $domain_availabilities = $logic_boxes->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 = $logic_boxes->suggest_domain_names(
    phrase      => 'fast race cars',
    tlds        => [qw( com net org )],
    hyphen      => 0,   # DEPRECATED!  Will Generate Warnings (see Method for more information)
    related     => 1,
    num_results => 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 LogicBoxes's API.

METHODS

check_domain_availability

use WWW::LogicBoxes;

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

# Check If Domains Are Available
my $domain_availabilities = $logic_boxes->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";
    }
}

Given an ArrayRef of slds and tlds returns an ArrayRef of WWW::LogicBoxes::DomainAvailability objects. Optionally takes suggestions params (defaults to false), if specified then additional domain suggestions will be returned using a search term of the list of slds concatenated together with spaces.

suggest_domain_names

use WWW::LogicBoxes;

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

my $domain_availabilities = $logic_boxes->suggest_domain_names(
    phrase      => 'fast race cars',
    tlds        => [qw( com net org )],
    hyphen      => 0,     # DEPRECATED!  Will Generate Warnings.
    related     => 0,
    num_results => 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";
    }
}

Accepts the following arguments:

phrase

A search phrase to be used for domain suggestions

tlds

ArrayRef of Public Suffixes to return domains for.

hyphen

Default false, if true will include - hacks.

NOTE THIS ATTRIBUTE IS DEPRECATED. Passing it is still supported (for backwards compaitability) but it has not effect on the results. Usage will generated the carp'ed warning 'The hyphen argument is deprecated, please see POD for more information''

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.

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