GeoIP C lib bindings

This is a library which provides a single function. The function takes
as input an IP address and it outputs a hash containing best-guess
geographical information (like city, country, latitude, and
longitude).

Actually this is only a Ruby binding to a C library which provides
this function. Also, you must download a large binary database with
all this mapping information. It is kindly provided free of charge by
MaxMind.com.

There are other attempts at providing this functionality in Ruby but
mine is very simple and fast.

http://s3.amazonaws.com/four.livejournal/20071026/GeoIPCity-0.0.1.tgz
http://s3.amazonaws.com/four.livejournal/20071026/GeoIPCity-0.0.1.gem

ry

ry dahl wrote:

There are other attempts at providing this functionality in Ruby but
mine is very simple and fast.

Have you compared the performance of your library, Sean Chittendon’s
previous library that also used the C back-end, and my pure-Ruby gem?

The disk I/O time dominates, so the difference in performance is almost
imperceptible (or at least, depends on other things like the
availability
of physical memory, etc).

The pure Ruby version is much more convenient, of course. That’s why I
wrote it to replace Sean’s version… I don’t think we needed still a
third version.

Clifford H…

ry dahl wrote:

If I remember correctly, Sean’s wasn’t working for the city database
and it was rather a large amount of code. This is just 79 lines of c -
so it is compact and does, probably, all of what people want it to do.
that is, if they have access to a compiler.

Sure. I’m certain there are times it’ll be useful.

Clifford H…

Hi Clifford,

If I remember correctly, Sean’s wasn’t working for the city database
and it was rather a large amount of code. This is just 79 lines of c -
so it is compact and does, probably, all of what people want it to do.
that is, if they have access to a compiler.

The silly thing is I’ve spent more time “releasing” it than i did
actually writing it :slight_smile:

ry

On Oct 26, 9:46 pm, Clifford H. [email protected] wrote:

The pure Ruby version is much more convenient, of course. That’s why I
wrote it to replace Sean’s version… I don’t think we needed still a
third version.

Clifford H…

Clifford,

What’s the URL for your all ruby code?

Mike B.

barjunk wrote:

What’s the URL for your all ruby code?

gem install geoip

or, if you insist, http://geoip.rubyforge.org :-).

Clifford H., Data Constellation