Geoip

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

    Using GeoIP, for example, you can determine the preferred localization of your project for a new user. It’s nice to visit a site with a default interface 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"]

    Also popular now: