I've translated some of the GPL'd GeoIP (Geographic database by IP
address) C library code to perform country lookups against the free
GeoIP database (from www.maxmind.com) using pure Ruby. It should
work with all the commercial GeoIP databases also, but doesn't
implement the non-free features.
This is an alternative to Sean's Ruby wrapper for the native code
version. The code is 266 lines. What's the best way to provide it
to the community - as a Gem perhaps? What's the procedure? I don't
feel inclined to spend much effort packaging or documenting it.
Alternatively, if someone cares to test it against the commercial
versions of the database, I might be inclined to finish those
features.
The data file it uses contains a binary tree, which appears to be
built from the FTP files downloadable from the big four NICs. It
wouldn't be hard to implement a procedure to build one periodically,
and in fact I have a Ruby script that fetches the relevant files
using FTP already. I'm guessing that it wouldn't be hard to get
city information as well, by extracting the location data from
whois lookups.
Clifford Heath, cjh at the polyplex organization ;-).
Then most folks won't touch it. If you really want feedback, you
should package it properly. That *especially* includes proper
documentation. Generally speaking that means:
* An install script of some sort.
* Documentation
* A README that contains a brief synopsis, perhaps license info,
contact info, etc.
* Unit tests - you did test your code, right?
That's a start.
Regards,
Dan
I don't want feedback, except on whether anyone thinks it's worth
packaging. The answer is apparently not. Perhaps I'll get around
to just posting it for all and sundry to just file away....