Skip to content

dynamix/fastgeoip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fastgeoip

Small and simple wrapper for MaxMind GeoIP (country). Partly based on the MaxMind GeoIP C Code and the Net/GeoIP extension.

Currently the only supported operations are:

  • open a database

  • ip to country iso code lookup

… but it is fast ;-)

How to use

gem install fastgeoip

Download the GeoIP database geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz

require 'fastgeoip'                   

db = FastGeoIp.open 'path-to-yor-data-file/GeoIP.dat'
db.country_code_by_addr('81.1.1.1') # should yield 'US'

Todo

  • add tests

Changelog

0.2.0 - Ruby 1.9 support 0.1.0 - initial release

Copyright © 2010 Martin Karlsch. See LICENSE for details.

About

Very simple and fast wrapper for MaxMind GeoIP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published