Руслан У. Закиров > Geo-IP-RU-IpGeoBase-0.03 > Geo::IP::RU::IpGeoBase

Download:
Geo-IP-RU-IpGeoBase-0.03.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.03   Source   Latest Release: Geo-IP-RU-IpGeoBase-0.04

NAME ^

Geo::IP::RU::IpGeoBase - look up location by IP address in Russia

DESCRIPTION ^

This module allows you to look up location in DB provided by http://ipgeobase.ru service. Access to the DB is free. Contains information about city, region, federal district and coordinates.

DB provided as plain text files and is not very suitable for look ups without loading all data into memory. Instead it's been decided to import data into a database. Use command line utility to create and update back-end DB.

At this moment DB can be created in SQLite, mysql and Pg. If you create table manually then probably module will just work. It's very easy to add support for more back-end DBs. Patches are welcome.

METHODS ^

new

Returns a new object. Takes a hash with options, mostly description of the back-end:

    Geo::IP::RU::IpGeoBase->new( db => {
        dbh => $dbh, table => 'my_table',
    } );
    # or
    Geo::IP::RU::IpGeoBase->new( db => {
        dsn => 'dbi:mysql:mydb',
        user => 'root', pass => 'secret',
        table => 'my_table',
    } );

find_by_ip

Takes an IP in 'xxx.xxx.xxx.xxx' format and returns information about blocks that contains this IP. Yep, blocks, not a block. In theory DB may contain intersecting blocks.

Each record is a hash reference with the fields matching table columns: istart, iend, start, end, city, region, federal_district, latitude and longitude.

AUTHOR ^

Ruslan Zakirov >Ruslan.Zakirov@gmail.com<

LICENSE ^

Under the same terms as perl itself.

syntax highlighting: