IP::Info - Interface to IP geographic and network data.
Version 0.06
Quova RESTful API provides the geographic location and network data for any Internet Protocol address in the public address space. The information includes:
Postal code, city, state, region, country, and continent
Area code (US and Canada only) and time zone
Longitude and latitude
DMA (Designated Market Area) and MSA (Metropolitan Statistical Area)
Network information, including type, speed, carrier, and registering organization
The constructor requires the following parameters as listed below:
+--------+----------+----------------------------------------+ | Key | Required | Description | +--------+----------+----------------------------------------+ | apikey | Yes | API Key given by Quova. | | secret | Yes | Allocated share secret given by Quova. | +--------+----------+----------------------------------------+
To obtain your Quova API key (apikey) and the shared secret, register your application here at http://developer.quova.com/
use strict; use warnings; use IP::Info; my ($apikey, $secret, $info); $apikey = 'Your_API_Key'; $secret = 'Your_shared_secret'; $info = IP::Info->new($apikey, $secret); # or $info = IP::Info->new({ apikey => $apikey, secret => $secret});
If an IP address is specified in the correct format, then the call returns an object of type IP::Info::Response object which can be queried further to look for specific information for that IP.In case it encounters any error it will throw an exception of type HTTP::Exception. Also throw NoDataFoundException in case no data found for the given IP address.
The IP must be a standard, 32-bit IPv4 address. The allowed IP formats are
dot-decimal e.g. 4.2.2.2
decimal notation e.g. 67240450
use strict; use warnings; use IP::Info; my $apikey = 'Your_API_Key'; my $secret = 'Your_shared_secret'; my $ipaddress = '4.2.2.2'; my $info = IP::Info->new($apikey, $secret); eval { my $response = $info->ipaddress($ipaddress); print "Country: [".$response->country(). "]\n"; }; my $e = HTTP::Exception->caught; print "Error code: [".$e->code."]\n" if defined $e; $e = Exception::Class->caught('NoDataFoundException'); print "NoDataFoundException caught.\n" if defined $e;
Saves the XML Schema Document in the given file (.xsd file). In case it encounters any error it will throw an exception of type HTTP::Exception. Also throw NoDataFoundException in case no data found.
use strict; use warnings; use IP::Info; my $apikey = 'Your_API_Key'; my $secret = 'Your_shared_secret'; my $info = IP::Info->new($apikey, $secret); eval { $info->schema('User_supplied_filename.xsd') }; my $e = HTTP::Exception->caught; print "Error code: [".$e->code."]\n" if defined $e; $e = Exception::Class->caught('NoDataFoundException'); print "NoDataFoundException caught.\n" if defined $e;
Mohammad S Anwar, <mohammad.anwar at yahoo.com>
<mohammad.anwar at yahoo.com>
Please report any bugs or feature requests to bug-ip-info at rt.cpan.org or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=IP-Info. I will be notified and then you'll automatically be notified of progress on your bug as I make changes.
bug-ip-info at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc IP::Info
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=IP-Info
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/IP-Info
CPAN Ratings
http://cpanratings.perl.org/d/IP-Info
Search CPAN
http://search.cpan.org/dist/IP-Info/
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To install IP::Info, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IP::Info
CPAN shell
perl -MCPAN -e shell install IP::Info
For more information on module installation, please visit the detailed CPAN module installation guide.