If you want to share your trips on dopplr (or some other iCal compatible server), but want to manage trips and appointments using a desktop application like KOrganizer (or some other calendar that supports the iCalendar format, but not iCal's way of publishing), the below is for you.
First of all, you need to create a separate calendar for your trips, stored in a separate iCalendar (ics) file. In KOrganizer, setting up a new calendar is easy, but you have to go into the configuration options and tell it to ask you into which calendar new entries should be stored - otherwise, everything will always go to the same (the default) calendar. This sucks a bit.
To upload things, get the URL of your personal upload directory from Dopplr. You can find it by going to your dopplr page, click "your account", find the "getting things into dopplr" section, click "calendars and events" - or just go to http://www.dopplr.com/account/sources directly. On the resulting page find the URL for use with Apple iCal - it should look something like this: https://www.dopplr.com/upload/youruploadtoken/ - where youruploadtoken is a secret (!) upload token unique to your account.
The first script is called ics2dopplr and simply takes an iCalendar (*.ics) file and uploads it to your dopplr account (using the HTTP PUT command -- thanks to Tom Insam for the crucial hint):
#!/bin/bash f="$1" n=`basename "$f"` name="${n%%.*}" token="youruploadtoken" curl -s -S -T "$f" "https://www.dopplr.com/upload/$token/$name"
Don't forget to replace youredittoken by the actual edit token from your personal upload URL. Usage of this script is simply
ics2dopplr <filename>
Uploading may take a while (twenty seconds even for a small file, longer for large files). If successful, the response should be thanks!.
The second script is called update-dopplr and is designed for use with cron. It uploads the given iCalendar file only if it was changed since it was last uploaded.
#!/bin/bash dir=`dirname "$0"` f="$1" d=`dirname "$f"` n=`basename "$f"` t="$d/.$n.timestamp" if [ -f "$t" ] && [ "$t" -nt "$f" ]; then exit 33 fi ( "$dir/ics2dopplr" "$f" && echo `date -u` > "$t" ) | grep -v '^thanks!'
The time the file was last uploaded is remembered in a dot-file with a name derived from the original file name. To call this script directly, use
update-dopplr <filename>
The idea is to let this run in regular intervals, so changes to your local iCalendar file get published to dopplr automatically. To have it run every hour, call crontab -e and add the following line:
@hourly update-dopplr <filename>
This should get your dopplr account updated, new trips will get added automatically, and when you delete something from your local calendar, it will be deleted from dopplr too. The script generates no output, unless an error occurs. This way, cron will not bother you unless something bad happens.
This is all a pretty clumsy hack -- thanks to open standards (iCalendar and HTTP) it works, but because of a lack of more and better open standards, it doesn't work very well. I would really like to see universal support for CalDAV and/or GroupDAV - or at least "real" WebDAV, as opposed to plain ol' PUT.
| Free Content |
Regarding all software published on this site,
please note the software disclaimers page!




(no comments yet)