Friday, April 21, 2006

Synchronize Google Calendar to iPod with wget

It's ridiculously simple to download your Google Calendar to your iPod, at least if you have wget.

#!/bin/bash
dest='/media/ipod/Calendars'
name='my-google-calendar'
url='http://www.google.com/calendar/ical/.../.../basic'
[ -d "${dest}" ] && wget -q -r -P "${dest}" -O "${name}" "${dest}" "${url}"

Set dest to the location of your iPod's Calendars directory (when it is mounted as a USB disk) and url to the location of your Google Calendar iCal calendar. To get this URL, click the Manage calendars link, then Share this calendar, Calendar details, and then the ICAL link (either public or private, depending on your settings).

Then run the script periodically, like with cron. If the iPod is not mounted, it'll bail out and not try to syncronize.

If you don't have wgtet, you can substitute curl or lynx or some other command-line web tool.

No comments: