Search notes:

Perl module Geo::Coder::HostIP

Geo::Coder::HostIP needs the webservice of http://www.hostip.info/ (api.hostip.info). Unfortunatly, this service does not seem to work any more.
#!/usr/bin/perl
use warnings;
use strict;

use Geo::Coder::HostIP;

my $ipnr = shift or die;

# I can even call it menlo …
my $menlo     = Geo::Coder::HostIP->new; # default Server: www.hostip.info


#  Get the coordinates.
#  If successful, it also fills other values
#  into $menlo, such as CountryCode etc, see below
my @coordinates = $menlo->FetchIP($ipnr);

if (@coordinates) {
  printf "lat %s, lon %s\n", @coordinates;
  printf "Country code: %s\n", $menlo->CountryCode;
} else {
    print "Nothing found for $ipnr\n";
}
Github repository PerlModules, path: /Geo/Coder/HostIP/script.pl

See also

Github repository
Geo::IP, GeoIP2::WebService::Client
Perl modules.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1741107113, '3.140.192.173', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Perl/modules/Geo/Coder/HostIP/index(69): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78