Needs to Test Website in California- Does any tool exist

Go To StackoverFlow.com

0

I have a website which checks users IP and if its from CA displays a message.

I am using JQuery to check users IP, the code is at http://jquery-howto.blogspot.in/2009/04/get-geographical-location-geolocation.html

I have implemented the code in my website

My question is :

How do i check if the code works ? Because i am not based in California

2012-04-04 04:00
by user580950


1

The sample code they give there does return state. Note that they give a new URL:

// Utilize the JSONP API
$.getJSON('http://www.geoplugin.net/json.gp?jsoncallback=?', function(data){
    var region = data['geoplugin_region'];
    var country = data['geoplugin_countryCode'];
    if(country == 'US' && region == 'CA')
    {
      console.log("In CA");
    }
    else
    {
      console.log("In " + region + ", " + country);
    }
});

This is not the only API you can use by any means.

Demo

2012-04-04 04:09
by Matthew Flaschen
Thanks that helps, Please check my Edited Questio - user580950 2012-04-04 07:38
You can try using a proxy in California - Matthew Flaschen 2012-04-04 13:39


3

Geolocation is not 100% accurate (for example, almost all AOL users look like they're in Virginia).

If you can accept that imperfection, there are many web services and downloadable databases out there that will geolocate the IP.

I have had good experience with MaxMind (they are not the most accurate, but they are quite accurate for the price, and they seem to have a free version now that is "less accurate" than the paid product).

A quick Google search will turn up many other alternatives, including

Be sure to review the terms of service of whichever you select.

2012-04-04 04:02
by Eric J.
There are still AOL users - Greg Hewgill 2012-04-04 04:07
Please check my Edited Questio - user580950 2012-04-04 07:08
Ads