TIP GeoIPPlugin is not installed on Foswiki.org.

GeoIPPlugin

Geo Location Information

Description

This plugin lets access GeoIP information as provided by MaxMind. Use GeoIP intelligence for content personalization, ad targeting, traffic analysis, digital rights management and more. The plugin needs the GeoIP database to be downloaded to the wiki server. Either use the professional version or the GeoLite2 database. This plugin integrates well with GoogleMapsPlugin to display the location of an IP address directly on a map. You may either download the data yourself or let the plugin download it by itself from a configurable URL.

GeoLite2 License

The GeoLite2 databases are distributed under the Creative Commons Attribution-ShareAlike 4.0 International License. The attribution requirement may be met by including the following in all advertising and documentation mentioning features of or use of this database:

This product includes GeoLite2 data created by MaxMind, available from
<a href="http://www.maxmind.com">http://www.maxmind.com</a>.

Syntax

%GEOIP{"<ip-addr>" format="$postal_code $city, $country ($country_cod)"}%

Parameter Description Default
"..." ip address current remote address
format format string; see below for more info $city

The following variables may be used in a format string to expand to the according properties of a data record. Note that some information is not available in the freely available GeoLite2 version of the database.

  • $addr
  • $found
  • $city
  • $city_id
  • $country
  • $country_id
  • $country_code
  • $continent
  • $continent_id
  • $continent_code
  • $location_accuracy_radius
  • $location_average_income
  • $location_latitude
  • $location_longitude
  • $location_population_density
  • $location_time_zone
  • $postal_code
  • $traits_autonomous_system_number
  • $traits_autonomous_system_organization
  • $traits_connection_type
  • $traits_domain
  • $traits_isp
  • $traits_organization
  • $traits_user_type
  • $traits_is_anonymous
  • $traits_is_anonymous_vpn
  • $traits_is_hosting_provider
  • $traits_is_legitimate_proxy
  • $traits_is_public_proxy
  • $traits_is_satellite_provider
  • $traits_is_tor_exit_node

Examples

%GEOIP{"%URLPARAM{"addr"}%"
   format="$percntIF{\"$found\" 
            then=\"You come from $postal_code $city $country ($country_code)\"
            else=\"Unknown address $addr.\"
          }$percnt"
}%

%GEOIP{"%URLPARAM{"addr"}%" format="
| *Propertyp* | *Value* |
| city | $city |
| city_id | $city_id |
| postal_code | $postal_code |
| country | $country |
| country_id | $country_id |
| country_code | $country_code |
| country_is_in_european_union | $country_is_in_european_union |
| continent | $continent |
| continent_id | $continent_id |
| continent_code | $continent_code |
| location_latitude | $location_latitude |
| location_longitude | $location_longitude |
| location_accuracy_radius | $location_accuracy_radius |
| location_time_zone | $location_time_zone |
| location_population_density | $location_population_density |
| location_average_income | $location_average_income |
| traits_autonomous_system_number | $traits_autonomous_system_number |
| traits_autonomous_system_organization | $traits_autonomous_system_organization |
| traits_connection_type | $traits_connection_type |
| traits_domain | $traits_domain |
| traits_isp | $traits_isp |
| traits_usertype | $traits_user_type |
| traits_organization | $traits_organization |
| traits_is_anonymous | $traits_is_anonymous |
| traits_is_anonymous_vpn | $traits_is_anonymous_vpn |
| traits_is_hosting_provider | $traits_is_hosting_provider |
| traits_is_legitimate_proxy | $traits_is_legitimate_proxy |
| traits_is_public_proxy | $traits_is_public_proxy |
| traits_is_satellite_provider | $traits_is_satellite_provider |
| traits_is_tor_exit_node | $traits_is_tor_exit_node | 
"}%

%GEOIP{"%URLPARAM{"addr"}%" format="
$percntGOOGLEMAPS{
   center=\"$location_latitude,$location_longitude\"
   markeraddress=\"$location_latitude,$location_longitude\"
   zoom=\"10\"
   height=\"600px\"
}$percnt"}%

Installation Instructions

This plugin makes use of the CPAN:GeoIP2 perl module. It only depends on the pure Perl implementation of the MaxMind database reader CPAN:MaxMind::DB::Reader. If you install the libmaxminddb library (http://maxmind.github.io/libmaxminddb/) and CPAN:MaxMind::DB::Reader::XS, then the XS implementation will be loaded automatically. The XS implementation is approximately 100x faster than the pure Perl implementation.

On ubuntu systems you may use this repository to install the required binaries.

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. "Extensions Operation and Maintenance" Tab -> "Install, Update or Remove extensions" Tab. Click the "Search for Extensions" button. Enter part of the extension name or description and press search. Select the desired extension(s) and click install. If an extension is already installed, it will not show up in the search results.

You can also install from the shell by running the extension installer as the web server user: (Be sure to run as the webserver user, not as root!)
cd /path/to/foswiki
perl tools/extension_installer <NameOfExtension> install

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See https://foswiki.org/Support/ManuallyInstallingExtensions for more help.

Dependencies

NameVersionDescription
GeoIP2>=2Required
Try::Tiny>=0Required
LWP::Simple>=0Required
Archive::Tar>=0Required
MaxMind::DB::Reader>=1Required
MaxMind::DB::Reader::XS>=1Optional

Change History

12 Nov 2019 added downloader for the GeoLite2 database
17 Sep 2018 initial release

PackageForm edit

Author Michael Daum
Version 2.00
Release 21 Oct 2019
Description Geo Location Information
Copyright 2017-2019 Michael Daum http://michaeldaumconsulting.com
License GPL (GNU General Public License)
Home https://foswiki.org/Extensions/GeoIPPlugin
Support https://foswiki.org/Support/GeoIPPlugin
Repository https://github.com/foswiki/GeoIPPlugin
ExtensionClassification Information structuring and Search, Interface and Visualisation
ExtensionType PluginPackage
Compatibility
IncompatibleWith
ImageUrl
DemoUrl http://
SupportUrl GeoIPPlugin
ModificationPolicy CoordinateWithAuthor
I Attachment Action Size Date Who Comment
GeoIPPlugin.md5md5 GeoIPPlugin.md5 manage 156 bytes 12 Nov 2019 - 11:28 MichaelDaum  
GeoIPPlugin.sha1sha1 GeoIPPlugin.sha1 manage 180 bytes 12 Nov 2019 - 11:28 MichaelDaum  
GeoIPPlugin.tgztgz GeoIPPlugin.tgz manage 7 K 12 Nov 2019 - 11:27 MichaelDaum  
GeoIPPlugin.zipzip GeoIPPlugin.zip manage 10 K 12 Nov 2019 - 11:27 MichaelDaum  
GeoIPPlugin_installerEXT GeoIPPlugin_installer manage 4 K 12 Nov 2019 - 11:27 MichaelDaum  
Topic revision: r2 - 12 Nov 2019, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy