Not sure how new this protocol is, but there appears to be a standard for getting location info in XML. You provide an IP address, and the service returns back the geographic coordinates, the name of the location, the country.
If you don’t specify the IP address, it uses the client IP that made the call. I need this because Amazon EC2 servers are assigned internal IP addresses. This is a way to find out the IP address you’re seen by externally. I could have written my own web service for this, but then I’d have to keep it running. ![]()
So there’s a new verb, tcp.getLocationInfo.
tcp.getLocationInfo (adrtable, ip=nil, apiUrl=nil)
It takes three parameters, the address of a table to receive the location info and an optional IP address and address of the web service (in case you want to call a different one from the default).
By default it calls this web service:
http://api.hostip.info/?ip=75.101.165.156
If you click on that link you’ll see the XML that this verb parses for you.
Posted by Rich on March 28, 2010 at 11:01 am
Clicking on the link displays raw code in both Firefox and IE8.
When I remove the existing IP from the link and read the code it resolves my IP correctly but it says I’m in Atlanta instead of Las Vegas.
Posted by Dave Winer on March 28, 2010 at 11:13 am
It’s like telling a doctor — when I slice open my arm this red stuff comes spurting out. Yeah, that’s right — he’d say.
This is not for end-users Rich, it’s infrastructure.
Posted by Rich on March 28, 2010 at 10:39 pm
Don’t know where my brain was, but, man did I have that one coming. – I used their service on a project back in 2006
What I was trying to elicit was a response as to the accuracy of the data. I’ve tried 3 ips and gotten either incorrect or no information, and I was wondering if you had any input.
Posted by Frontier News – Der Schockwellenreiter on March 29, 2010 at 3:50 am
[...] An den Wochenenden scheint Dave Winer Zeit zu haben, am OPML Editor zu basteln, und so hat er dieses Mal einen Geolocation-Service für Frontier geschrieben: Getting location info from a Frontier script. [...]