Does anyone know of a non-anonymous (seems to attract strange folk) location based content indexing/retrieval solution?
I’ve done IP based location specific content before. But that was when hosting on my own server. The code I used was:
function GeoData($ip)
{
$Content = CurlGet("http://api.hostip.info/get_html.php?ip=" . $ip . "&position=true");
$ContentArr = explode("\n", $Content);
$Stack = array();
$Ctr = 0;
foreach($ContentArr as $Item)
{
if($Ctr == 2)
{
$Ctr++;
continue;
}
if($Ctr == 6)
break;
$SingleItemArr = explode(":", $Item);
array_push($Stack, $SingleItemArr[1]);
$Ctr++;
}
$MappedStr = array("country" => $Stack[0], "city" => $Stack[1], "latitude" => $Stack[2], "longitude" => $Stack[3], "ip" => $Stack[4]);
$JsonEncoded = json_encode($MappedStr);
return $JsonEncoded;
}
and I got the IP with: $_SERVER['REMOTE_ADDR']
Not sure if this will work on Infinity free though
1 Like
I was more wondering if people could geo tag content for use in a search engine, kind of like Flickr does with pictures.
Oh I see, I thought you wanted to direct people to different content on your site dependent on region…
I’m afraid I’m not sure about that one