Home > Programming, Servers & Scripts >

Free geoip service telize (1)


04-08-2015 06:21 AM #1 mattboy (Member)
Free geoip service telize

This is a service I just started testing recently. It's free, so I thought some of you here might find it useful.

Just go to the site telize.com for details on usage. Its pretty simple, just call their script and write out whatever variables you need.

It can display ip, city, country_code, latitude, area_code and so on.

I am only using it for city.

To use, here is their example:

Code:
<script type="application/javascript">
    function getgeoip(json){
    	document.write("Geolocation information for IP address : ", json.ip);
    	document.write("Country : ", json.country);
    	document.write("Latitude : ", json.latitude);
    	document.write("Longitude : ", json.longitude);
    }
</script>

<script type="application/javascript" src="http://www.telize.com/geoip?callback=getgeoip"></script>
I was having some issues with the way that display, so I declared variable in head of the document, then output wherever needed:
Code:
<script type="application/javascript">
 var cityString = '';
function getgeoip(json){
    	cityString = json.city;
}
</script>
<script type="application/javascript" src="http://www.telize.com/geoip?callback=getgeoip"></script>
THen just document.write the var wherever needed.


Home > Programming, Servers & Scripts >