Hi Mimi,
 Determining a city from an IP address is documented on the
Geo::IP2Location CPAN page:

> use Geo::IP2Location;
> my $obj = 
> Geo::IP2Location->open("IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-ISP-DOMAIN.BIN");
> my $city = $obj->get_city("20.11.187.239");

http://search.cpan.org/~location/Geo-IP2Location-2.10/lib/Geo/IP2Location.pm

On Wed, Sep 15, 2010 at 2:37 PM, Mimi Cafe <mimic...@googlemail.com> wrote:
>
> Hi
>
> I need to automatically determine web users' location and provide them with
> targeting products. I am aware I can capture their IP address and do DNS
> lookup of some kind, but how do I find their country and city from the DNS
> information.
>
> Recently I noticed that some of the web sites I visit automatically detect
> my location (country and city) and display products and services near me
> (without me providing any information).
>
> As far as I know, Net::DNS alone cannot be to achieve this. Anyone
> experience on this and can advise (perhaps sample code or ways of
> implementation)?
>
> I just found few cpan modules (Geo::IP2Location, Geo::IP) which both use
> flat file databases to lookup country an IP is originating from, but I yet
> to understand how the originating city can be determined.  Any other
> suggestions?
>
> Mimi

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to