Path: | website/index.txt |
Last Update: | Thu Mar 12 18:40:59 -0700 2009 |
h1. geoip
h2. &x2192; ‘Geographic info for an IP address‘
h2. What
GeoIP searches a GeoIP database for a given host or IP address, and returns information about the country where the IP address is allocated.
h2. Installing
<pre syntax="ruby">sudo gem install geoip</pre>
h2. Prerequisites
You need at least the free GeoIP.dat, for which the last known download location is "www.maxmind.com/download/geoip/database/GeoIP.dat.gz":http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz This API requires the file to be decompressed for searching. Other versions of this database are available for purchase which contain more detailed information, but this information is not returned by this implementation. See www.maxmind.com for more information.
h2. Example
require 'geoip' GeoIP.new('GeoIP.dat').country("www.netscape.sk") => ["www.netscape.sk", "217.67.16.35", 196, "SK", "SVK", "Slovakia", "EU"]
h2. How to submit patches
Read the "8 steps for fixing other people‘s code":drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8z: Submit patch":drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8z-email, email me on the link below.
The trunk repository is svn://rubyforge.org/var/svn/geoip/trunk for anonymous access.
Read the "8 steps for fixing other people‘s code":drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
h2. License
This code is free to use under the terms of the GPL license. I don‘t normally use the GPL license, but this one is derived from Maxmind‘s code, so I use the license they use.
h2. Contact
Comments are welcome. Send an email to "Clifford Heath":cjheath@rubyforge.org .