Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "geoip"

Title:Access GeoIP library
Rating:Not rated. Create the first rating!
Latest version:0.9.0
SHA1 sum:62c3a941ae50a33010a2da9ce034fff3d25cb553
Author:Jan Wielemaker <jan@swi-prolog.org>
Home page:https://github.com/JanWielemaker/geoip
Download URL:https://github.com/JanWielemaker/geoip/archive/*.zip

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.9.051380c4a51ef187c97b095bb8e4ad65752bc4e9730https://github.com/JanWielemaker/geoip/archive/V0.9.0.zip
62c3a941ae50a33010a2da9ce034fff3d25cb5533https://github.com/JanWielemaker/geoip/archive/V0.9.0.zip

GeoIP lookup for SWI-Prolog

This library provides a minimal interface to the public GeoIP library from MAXMIND

It has been tested with the Ubuntu package libgeoip-dev with the databases from the package geoip-database-contrib, which are by default installed in =/usr/share/GeoIP=. A simple usage is:

?- tcp_host_to_address('www.swi-prolog.org', IP),
   geoip_lookup(IP, R).
R = geoip{city:'Amsterdam',
          continent_code:'EU',
          country_code:'NL',
          country_code3:'NLD',
          country_name:'Netherlands',
          latitude:52.349998474121094,
          longitude:4.9166998863220215,
          netmask:16,
          region:'07'}.

Installation

WARNING This installation will only work on a machine where libgeoip can be installed in a globally searched place and where C development tools are provided.

  1. Install GeoIP library and database. The command for Ubuntu 14.04 is below.
    sudo apt-get install geoip-database-contrib libgeoip-dev
  2. Install the pack
    ?- pack_install(geopip).

Contents of pack "geoip"

Pack contains 6 files holding a total of 14.0K bytes.