Giter Club home page Giter Club logo

geoip's Introduction

geoip

github.com/cjheath/geoip

DESCRIPTION:

GeoIP searches a GeoIP database for a given host or IP address, and returns information about the country where the IP address is allocated, and the city, ISP and other information, if you have that database version.

FEATURES/PROBLEMS:

Includes support for ASN data files, thanks to Roland Matiz. This release adds support for timezone names, thanks to Tonni Aagesen.

SYNOPSIS:

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"]

Returned values are the requested hostname, the IP address as a dotted quad,
Maxmind's country code, the ISO3166-1 country code, the ISO3166-2 country code,
the ISO3166 country name, and the continent code.

GeoIP.new('GeoCity.dat').city('github.com')
=> ["github.com", "207.97.227.239", "US", "USA", "United States", "NA", "CA", "San Francisco", "94110", 37.7484, -122.4156, 807, 415, "America/Los_Angeles"]

Returned values are the country values followed by region or state name,
city name, postal_code/zipcode, latitude, longitude, USA DMA code, USA area code,
timezone name. Sorry it's not a Hash... historical.

GeoIP.new('GeoIPASNum.dat').asn("www.fsb.ru")
=> ["AS8342", "RTComm.RU Autonomous System"]

REQUIREMENTS:

You need at least the free GeoLiteCity.dat, for which the last known download location is <geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz>, or the city database from <www.maxmind.com/app/geolitecity>.

The ASN database location is <geolite.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz>.

This API requires the file to be decompressed for searching. Other versions of this database are available for purchase which contain more detailed information, but this information is not returned by this implementation. See www.maxmind.com for more information.

INSTALL:

sudo gem install geoip

LICENSE:

This version Copyright © 2005 Clifford Heath Derived from the C version, Copyright © 2003 MaxMind LLC

This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

geoip's People

Contributors

cjheath avatar ghazel avatar rakoth avatar rmoriz avatar secretfader avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.