Created
February 4, 2014 13:14
-
-
Save vicendominguez/8803359 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
# a lot of years ago... recovered | |
use Geo::IP2Location; | |
if ($#ARGV != 1 ) { | |
print "usage: checkip.pl <fichero.bin.ip> <ip>\n"; | |
exit; | |
} | |
$fichero=$ARGV[0]; | |
$IP=$ARGV[1]; | |
$obj = Geo::IP2Location->open($fichero); | |
my ($countryshort, $countrylong, $region, $city, $latitude, $longitude, $zipcode, $timezone, $isp, $domain, $netspeed) = $obj->get_all($IP); | |
print "\nhash: $obj\n"; | |
print "isp: $isp\n"; | |
print "ciudad: $city\n"; | |
print "pais: $countrylong\n"; | |
print "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment