1. Computing

Geoip is a Ruby gem used to convert IP addresses into physical locations. It may sound like magic, but it's much simpler than that. There are a number of databases available, some for free, that correlate this information, which itself comes from various locations, including your ISP and volunteered information. Though it's not always accurate, it can usually locate your town or county.

What is the use of this? I know we've all seen Web ads use this conversion technique; they always appear to magically know where you live. But, there are more practical uses, too.

Translating IPs to addresses is one of the only ways to reliably tell which country your Web users are from. When making an HTTP request, your Web browser sends a request noting in which language you'd prefer content, but it doesn't give many clues as to your specific location, namely your country. Having this data is incredibly valuable information if you have worldwide users.

Version 0.8.0 of Geoipis a bugfix release, so there are no new major features. Like many Ruby gems getting ready for Ruby 1.9.0 or Ruby 2.0 (both of which have native threads, as opposed to user threads like in Ruby 1.8.x) this bug fix has to do with thread safety.

September 1, 2008 at 9:37 am
(1) Ujjwal Trivedi says:

Now thats awesome! Thansk for this news i would have needed to roll out my own code pretty recently. seems like this should save some time.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>
Top Related Searches
  1. About.com
  2. Computing
  3. Ruby

©2014 About.com. All rights reserved.