Skip to content
Gun.io
January 27, 2017 · 3 min read

How to use Google Tasks CalDAV

The theme music for this post is Percy Sledge – The Dark End of the Street.

Cool! Gun.io user MatthewBauer has claimed the bounty to make a way to post to Google Tasks using Siri.

Siri to Google Tasks using CalDAV

Did you know you can use CalDAV to push tasks to Google Tasks through iPhone’s Siri?

Siri is the iPhone’s new fancy-pants program, which lets you talk to your phone and have it do things for you. And Google Tasks is Google’s lightweight task manager. You can use Google Tasks to capture tasks from anywhere and sync them across all your devices.

Together at last!

What is CalDAV account?

Google Tasks and iPhone work together using ‘CalDAV’ (aka “Calendaring Extensions to WebDAV”). CalDAV is an internet standard allowing a client to access scheduling information on a remote server.

Siri uses this mechanism to store tasks, and CalDAV – essentially a piece of code – takes the calendar events and pushes them over to Google Tasks.

How handy!

Setting up Google Tasks CalDAV

Implementing Google Tasks CalDAV requires a fair amount of technical knowledge, as it requires running your own server to handle the credentials and posting. You’ll need to run your own server to do this.

I suggest using this configuration in your /etc/httpd/conf/httpd.conf:

Siri is the iPhone’s new fancy-pants program which lets you talk to your phone and have it do things for you. Google Tasks is Google’s lightweight task manager. Together at last! It does it using ‘CalDAV’ (which means “Calendaring Extensions to WebDAV”), which is an Internet standard allowing a client to access scheduling information on a remote server.

This is the mechanism which Siri uses to store tasks, so this code takes the calendar events and pushes them over to Google Tasks. How handy!

Setting it up

This implementation requires a fair amount of technical knowledge to use, as it requires that you run your own server to handle the credentials and the posting. You’ll need to run your own server to do this.

The author suggests using this configuration in your /etc/httpd/conf/httpd.conf:

<VirtualHost *:80>
ServerName http://www.example.com
ServerAlias example.com
ServerAdmin [email protected]
WSGIScriptAlias /cal /srv/http/caldav-to-gtasks/server.py
<Directory /srv/http/caldav-to-gtasks/>
AuthType Basic
AuthName “WSGI”
AuthUserFile /etc/httpd/passwd/passwords
Require user USERNAME
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
view raw gistfile1.txt hosted with ❤ by GitHub

Then, once your server is running, visit the url http://servername/cal?oauth=1 to set your credentials.

Once you’ve done this, on your device, go to Settings -> Mail, Contacts, and Calendars -> Add Account -> Other -> Add CalDav Account. Type your credentials in and hit next. If you don’t have a username and password, just put in dummy ones.

It’ll fail at first, so tap ‘Advanced Settings’ and set Use SSL to OFF. Set the port to the port you’ve got Apache running and make ‘Account URL’ be something like this if you set the WSGIScriptAlias to /cal: http://servername:80/cal

And there you have it! Siri to Google Tasks CalDAV. Awesome.

Oh, and this is a totally open source implementation. Feel free to play with the code here!