[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

[ANN] GeoIP C lib bindings

ry dahl

10/26/2007 5:21:00 PM

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...
http://s3.amazonaws.com/four.livejournal/20071026/GeoIPCity...



ry

5 Answers

Clifford Heath

10/27/2007 5:46:00 AM

0

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

ry dahl

10/27/2007 12:04:00 PM

0

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 :)

ry

Clifford Heath

10/27/2007 2:20:00 PM

0

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

barjunk

10/28/2007 6:40:00 PM

0

On Oct 26, 9:46 pm, Clifford Heath <n...@spam.please.net> wrote:
> 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 Heath.

Clifford,

What's the URL for your all ruby code?

Mike B.

Clifford Heath

10/29/2007 7:49:00 AM

0

barjunk wrote:
> What's the URL for your all ruby code?

gem install geoip

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

Clifford Heath, Data Constellation