GeoPlugin
Geo location services
GeoPlugin provides geo-location services, implementing a lookup feature from IP address, domain name, or physical address.
It is a wrapper around the
CPAN:Geo::IP and
CPAN:Geo::GeoNames libraries.
Note that
GeoPlugin caches each request, so multiple instances on the same page do not slow things down.
Usage
%GEO{ "address" format="$country_code ($lat,$lng)" }%
address
can be one of:
- IP address
- Domain name
- Physical address
the
format
string can reference these defined variables
-
$country
-
$country_name
-
$latitude
-
$longitude
-
$time_zone
-
$region
(state or province, typically)
-
$city
-
$postal_code
(for USA addresses only (maybe Canadian, too))
-
$area_code
-
$metro_code
(for USA addresses only)
-
$query
the original query
-
$method
Geo::IP
or Geo::GeoNames
Examples
query |
country |
latitude |
longtitude |
time_zone |
region |
city |
postal_code |
area_code |
metro_code |
country_name |
continent |
method |
|
%GEO{ "%REMOTE_IP_ADDRESS%" }%
Installation Instructions
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. Use "Find More Extensions" to get a list of available extensions. Select "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
http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
To install the database(s) used by
CPAN:Geo::IP,
CPAN:Geo::GeoNames uses a webservice (I believe). I think there is a way to download a database, but I have not persued that yet.
Info