Matt
Matt

Reputation: 22911

How does Twitter get its geolocation data?

I was wondering if anyone knew how Twitter (or facebook) gets its geolocation data, like the various streets and possible buildings. It seems like Twitter gets it from Google, but does anyone know of any resources on how to set that up?

Thanks! Matt Mueller

Upvotes: 4

Views: 943

Answers (2)

Adrian Petrescu
Adrian Petrescu

Reputation: 17969

It does it through the HTML5 Geolocation API that is now supported by most modern browsers. Of course it is up to the browser's implementation of the interface to decide how to determine the location. A cell phone will figure it out very differently from a desktop machine, etc. For instance, Firefox uses a Google web service to do it based on the IP address, while Mobile Safari would use Core Location.

A quick Google search will turn up lots of information how to detect and use the capability.

Upvotes: 1

Mark Baijens
Mark Baijens

Reputation: 13222

Google doesn't parse from all locations either it seems. At least this seems not to work from Curacao. I'm working on a solution that is more stable. See my open question for details. If you just want google you can use this.

Include

<script type="text/javascript" src="http://www.google.com/jsapi"></script>

JS

if(google.loader.ClientLocation) {
  latitude = (google.loader.ClientLocation.latitude);
  longitude = (google.loader.ClientLocation.longitude);
}

Upvotes: 2

Related Questions