result.category_name) ngx.say("credits_consumed: ". result.category) ngx.say("category_name: ". result.address_type) ngx.say("category: ". result.elevation) ngx.say("usage_type: ". result.mobile_brand) ngx.say("elevation: ". result.weather_station_name) ngx.say("mcc: ". result.weather_station_code) ngx.say("weather_station_name: ". result.area_code) ngx.say("weather_station_code: ". result.region_name) ngx.say("city_name: ". result.response) ngx.say("country_code: ". ") elseif result.response = "OK " then - standard results ngx.say("response: ". Local result = ws:lookup(ip, addon, lang) Local ip = '8.8.8.8' local ws = ip2locationwebservice:open(apikey, apipackage, usessl) Local addon = 'continent,country,region,city,geotargeting,country_groupings,time_zone_info' - leave blank if no need Local lang = 'fr' - leave blank if no need Local apikey = 'YOUR_API_KEY' local apipackage = 'WS25' local usessl = true Local ip2locationwebservice = require( 'ip2locationwebservice') This method returns the web service credit balance in an object. This method returns an object containing the geolocation info. } QUERY USING THE IP2LOCATION WEB SERVICE Methods Local ip2loc = ip2location:new( '/usr/local/ip2location/IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEATHER-MOBILE-ELEVATION-USAGETYPE-ADDRESSTYPE-CATEGORY-DISTRICT-ASN.BIN') Local ip2location = require( 'ip2location') Returns the autonomous system number (ASN). Returns the geolocation information in an object. Methodsīelow are the methods supported in this package. Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses. Use the IPv4 BIN file if you just need to query IPv4 addresses. IP2Location Commercial BIN Data (Comprehensive):.This package requires IP2Location BIN data file to function. If you don't have an existing API key, you can subscribe for one at the below: The paid databases are available at under Premium subscription package.Īs an alternative, this package can also call the IP2Location Web Service. Free LITE databases are available at upon registration. The database will be updated on a monthly basis for greater accuracy. prevent password sharing and abuse of service.analyze your web server logs to determine the countries of your visitors.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |