Backup Google Calendar programmatically: https://www.google.com/calendar/exporticalzip
- by Michael
I'm struggling with writing a python script that automatically grabs the zip fail containing all my google calendars and stores it (as a backup) on my harddisk.
I'm using ClientLogin to get an authentication token (and successfully can obtain the token).
Unfortunately, i'm unable to retrieve the file at https://www.google.com/calendar/exporticalzip
It always asks me for the login credentials again by returning a login page as html (instead of the zip).
Here's the critical code:
post_data = post_data = urllib.urlencode({ 'auth': token, 'continue': zip_url})
request = urllib2.Request('https://www.google.com/calendar', post_data, header)
try:
f = urllib2.urlopen(request)
result = f.read()
except:
print "Error"
Anyone any ideas or done that before? Or an alternative idea how to backup all my calendars (automatically!)