📜 ⬆️ ⬇️

Geoip

GeoIP allows you to search for information about a country, city by IP address or host.

With GeoIP, you can, for example, determine the preferred localization of your project for a new user. It's nice to go to the site whose default interface is in your native language.

There are quite a few applications.

Installation:


sudo gem install geoip

Using:


require 'geoip'

GeoIP.new('GeoLiteCity.dat').country('www.atlantis.sk')
=> ["www.atlantis.sk", "217.67.18.26", "SK", "SVK", "Slovakia", "EU", "02", "Bratislava", "", 48.15, 17.1167, nil, nil, "Europe/Bratislava"]

')

Source: https://habr.com/ru/post/102119/


All Articles