Archive for February 25th, 2010

Ruby gem geoip and Rack::GeoIPCountry

wikipedia上对于geolocation的解释是这样的:

Geolocation is the identification of the real-world geographic location of an Internet-connected computer, mobile device, website visitor or other.

检测的方法貌似也有很多:

Geolocation can be performed by associating a geographic location with the Internet Protocol (IP) address, MAC address, RFID, hardware embedded article/production number, embedded software number (such as UUID, Exif/IPTC/XMP or modern steganography), invoice, Wi-Fi connection location, or device GPS coordinates, or other, perhaps self-disclosed information.

(班门弄斧一下先,呵呵呵呵)

ruby里面取到geo信息的一个相对方便的办法是使用rubygem geoip,虽然本质上还是使用maxmind的data,但是免去了编译和安装其c library的麻烦。
Continue reading →