Wednesday, July 24, 2013

Another one bites the dust

Is it just me or is the Google spring cleaning cramping your style?  Although the new maps are awesome, I am going to miss Google Latitude.  I just went through the separation anxiety with Google Reader and am starting to feel old as I miss the old days when things stayed the same.

Anyways, it's time to export your Google Latitude location history, and there's no good UI to do it.  However, you can export your whole history into local KML files.  The following Python script will create a list of URLs (month-by-month) that you can use to download your location history to your local disk.

#!/usr/bin/env python
import datetime
for year in range(2005, 2014):
  for month in range(1, 13):
    if month in (1, 3, 5, 7, 8, 10, 12):
        days = 31;
    elif month == 2:
        days = 27;
    else:
        days = 30;
    startTime = datetime.datetime(year, month, 1).strftime("%s")
    endTime   = datetime.datetime(year, month, days).strftime("%s")
    print str(year) + "/" + str(month) + "\thttps://maps.google.com/locationhistory/b/0/kml?startTime=" + startTime + "000&endTime=" + endTime + "000"

No comments:

Post a Comment