Hello,

IPLocation.db provides access to MaxMind's GeoLite City data as a - 
rather hefty- SQLite3 database.

http://alt.textdrive.com/assets/public/Nanoki/IPLocation.20090201.tar.bz2 
  (42.5 MB)

Usage example:

% sqlite3 IPLocation.db

select      location.start as start,
             location.end as end,
             city.name as city,
             region.name as region,
             region.code as region_code,
             country.name as country,
             country.code as country_code
from        location
join        city on city.id = location.city_id
join        region on region.id = city.region_id
join        country on country.id = region.country_id
where       location.start <= 1658712019
order by    location.start desc
limit       1;

 > 1658711808,1658712063,Annandale,New Jersey,NJ,United States,US

There is also a Lua [2] front-end for it:

#!/usr/bin/env lua

local IPLocation = require( 'IPLocation' )
local aLocation = IPLocation[ '128.112.155.165' ]

print( aLocation.city, aLocation.region, aLocation.country  )

 > Princeton    New Jersey      United States

Cheers,

--
PA.
http://alt.textdrive.com/nanoki/

[2] http://www.lua.org/about.html

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to