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
Name | Version | Description |
---|
GeoIP2 | >=2 | Required |
Try::Tiny | >=0 | Required |
LWP::Simple | >=0 | Required |
Archive::Tar | >=0 | Required |
MaxMind::DB::Reader | >=1 | Required |
MaxMind::DB::Reader::XS | >=1 | Optional |
Change History
12 Nov 2019 |
added downloader for the GeoLite2 database |
17 Sep 2018 |
initial release |