Displaying your Location from Twitter on your Site

I was giving this site a little tweak, and one thing I wanted to add was my current location to my contact details - I move around a lot, and getting calls at stupid hours was begging to get a little annoying.

The catch was, I didn’t want to have to update this information manually all the time - it would get tiresome quickly, and I would end up letting it go stale. I usually geotag tweets semi-regularly from my phone, so I figured that would be a great place to get the data.

I sat down, and whipped up a quick Sinatra application that looks for the latest tweet with coordinates, extracts them, and uses the google reverse geocoding service to determine the city name. To make it a little less stalkerish I kept the city as the finest level of granularity. This is then exported as a simple little JSON-P Service, as well as a redirect to a map of the location.

I deployed it to Heroku like usual, I love how simple they make it to get an app up and running. The running app can be found at http://whereami.lds.li, and the code is on github at http://github.com/lstoll/whereami

I integrate it in to this site with the following script:

Blog comments powered by Disqus