line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::DomainTools::NameSpinner; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
BEGIN { |
4
|
3
|
|
|
3
|
|
206283
|
use Exporter (); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
476
|
|
5
|
3
|
|
|
3
|
|
21
|
use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
521
|
|
6
|
3
|
|
|
3
|
|
8
|
$VERSION = "1.03"; |
7
|
3
|
|
|
|
|
70
|
@ISA = qw (Exporter); |
8
|
3
|
|
|
|
|
8
|
@EXPORT = qw (); |
9
|
3
|
|
|
|
|
5
|
@EXPORT_OK = qw (); |
10
|
3
|
|
|
|
|
99
|
%EXPORT_TAGS = (); |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
21
|
use base qw( WWW::DomainTools ); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
3060
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 NAME |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
WWW::DomainTools::NameSpinner - Suggest other domain names |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SYNOPSIS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use WWW::DomainTools::NameSpinner; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my $api = WWW::DomainTools::NameSpinner->new( |
25
|
|
|
|
|
|
|
key => '12345', |
26
|
|
|
|
|
|
|
partner => 'yourname', |
27
|
|
|
|
|
|
|
customer_ip => '1.2.3.4' |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
my $res = $api->request( |
31
|
|
|
|
|
|
|
ext => "COM|NET|ORG|INFO", |
32
|
|
|
|
|
|
|
q => 'example.com', |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 DESCRIPTION |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
This module allows you to use the Domain Tools name spinner API in to list |
38
|
|
|
|
|
|
|
domain name suggestions based on a domain that you pass in. You will |
39
|
|
|
|
|
|
|
need to get a license key from their site to use this tool. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
L |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 METHODS |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=over 4 |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=item request( url parameters hash ) |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
The keys and values expected are documented on the Domain Tools website. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
If the request is successful, the return value is either a hash reference or |
52
|
|
|
|
|
|
|
a string depending on the value of the 'format' parameter to the constructor. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
See the documentation for the new() method for more detailed information |
55
|
|
|
|
|
|
|
about 'format' and other standard parameters. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
If the HTTP request fails, this method will die. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=back |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=over 4 |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item new( options hash ) |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Valid keys are: |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=over 4 |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=item * url |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Your XML api full url. Eg. http://partnername.whoisapi.com/api.xml |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
The default is http://engine.whoisapi.com/api.xml |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item * key |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Your license key |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item * partner |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Your partner ID |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item * customer_ip |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
The (optional) IP of the customer that you are making the request for |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item * format |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
How you want the response returned when you call the request method. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
'hash' is the default and means that you want a hash reference returned which |
92
|
|
|
|
|
|
|
is built by using L. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
'xml' means that you want a string returned containing the raw XML response. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=item * timeout |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
The number of seconds that you want to wait before cancelling the HTTP request. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
default: 10 |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=item * lwp_ua |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
An instance of L to use for the requests. This will allow you |
105
|
|
|
|
|
|
|
to set up an L with all of the settings that you would like to |
106
|
|
|
|
|
|
|
use such as proxy settings etc. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
default: LWP::UserAgent->new |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=back |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=back |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 SEE ALSO |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
L |
117
|
|
|
|
|
|
|
L |
118
|
|
|
|
|
|
|
L |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head1 BUGS |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Please report bugs using the CPAN Request Tracker at L |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head1 AUTHOR |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
David Bartle |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 COPYRIGHT |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
This program is free software; you can redistribute |
131
|
|
|
|
|
|
|
it and/or modify it under the same terms as Perl itself. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
I am not affiliated with Domain Tools or Name Intelligence. The use of |
134
|
|
|
|
|
|
|
their API's are governed by their own terms of service: |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
http://www.domaintools.com/members/tos.html |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
The full text of the license can be found in the |
139
|
|
|
|
|
|
|
LICENSE file included with this module. |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=cut |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
sub _init { |
144
|
|
|
|
|
|
|
my ($self) = @_; |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
%{ $self->{default_params} } = ( |
147
|
|
|
|
|
|
|
appname => 'name_spinner', |
148
|
|
|
|
|
|
|
version => 4 |
149
|
|
|
|
|
|
|
); |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
1; |