Benjamin Golub's Blog

Current Location

November 09 at 09:25 AM

I travel a lot more than I used to. You can now keep track of where I am (approximately) in the sidebar of this blog. The data is pulled from my Dopplr account and represented using a Google Static Map.

def get_current_city(self):
    key = 'current_city/now'
    current_city = memcache.get(key)
    if not current_city:
        response = urlfetch.fetch("https://www.dopplr.com/api/traveller_info?format=js&token=" + settings.DOPPLR_TOKEN)
        if response.status_code == 200:
            data = simplejson.loads(response.content)
            current_city = data["traveller"]["current_city"]
            current_city["maps_api_key"] = settings.MAPS_API_KEY
            memcache.set(key, current_city, 60*60*5)
        else:
            current_city = None
    return current_city
Share on FriendFeed
code dopplr location
View comments

Search

Loading

Recent entries

  • Remove trailing slash on App Engine - June 07 at 11:52 AM
  • DIY cheap (or free!) macro photo studio - May 25 at 01:31 PM
  • Requested: My Photography Workflow/Equipment - Aperture - April 26 at 01:34 PM
  • Paris slideshow - March 31 at 11:38 AM
  • Phish is back - My history and Hampton 2009 - March 07 at 10:23 AM

Links

  • Archive
  • Email Benjamin Golub
  • FriendFeed

Photos

Reese getting a hug
Rochester, NY US
©2009 Benjamin Golub - FriendFeed - Creative Commons License - Source - Icons