[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

GeoIP.rb

John

3/8/2005 3:39:00 AM

Folk,

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 ;-).
3 Answers

djberg96

3/8/2005 6:07:00 AM

0

Clifford Heath wrote:
> Folk,
>
> 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.

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

John

3/10/2005 10:03:00 AM

0

Daniel Berger wrote:
> Then most folks won't touch it. If you really want feedback,

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....

John

3/11/2005 8:59:00 AM

0

Well, I had 2nd thoughts, wrote some doc and submitted it as a gem.
Watch for a GeoIP gem. Just one thing... the C library I perused
is GPL, so I've labelled this GPL too. Does the gem have to have
a copy of the GPL embedded?