-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Zerf edited this page Jun 8, 2016
·
2 revisions
Welcome to the gm_geoip wiki. Here you will find documentation for this module. For installation instructions and the like, see README.md in the repository. For example usage of this module, scroll down.
Opens an MMDB file and returns a GeoIPDB utilizing it.
GeoIPDB:GetIPInfo(string ipAddr)
Returns a table of GeoIP data for the given IP address.
First download the GeoLite2 City database and place it in your data folder, then run:
> require("geoip")
> TestDB = geoip.OpenDB("data/GeoLite2-City.mmdb")
> PrintTable(TestDB:GetIPInfo("8.8.8.8"))
accuracy_radius = 937
city = Mountain View
continent = NA
country = US
latitude = 37.386
longitude = -122.0838
state = CA
time_zone = America/Los_Angeles