NicJ.net

Todoist.com (and TodoistBackup.exe)

After reading David Allen’s Getting Things Done: The Art of Stress-Free Productivity a few years back (great book!), I was inspired to change the way I managed my to-do list. For quite a while, I had been maintaining my lists of tasks, projects, and ideas in a discombobulated mess of sticky notes, whiteboards, todo.txt’s, Outlook tasks, and random files on my hard drive. I took some of the ideas from GTD and applied them in a way that worked for me. I settled on two technologies: a wiki (for notes, lists etc), and todoist.com for task management.

There are several good web sites and programs out there that aim to let you apply Allen’s GTD principals, such as Remember The Milk (RTM), Todoist, Toodledo, Outlook, Google Tasks, and even maintaining a todo.txt. One of my favorite blogs is Lifehacker, which is focused on GTD stuff, and has covered todoist.com and RTM as well as similar sites. They’ve published a book called Lifehacker: 88 Tech Tricks to Turbocharge Your Day and a sequel Upgrade Your Life: The Lifehacker Guide to Working Smarter, Faster, Better, that are both fun reads. There’s been a lot of activity around GTD since the book was published, and many websites and apps attempt to provide a seamless way for people to manage their life in a GTD way.

After test-driving a few of the GTD web sites and programs, I settled on one that I’ve been using for 100% of my task management over the last three years: todoist.com. Todoist is a simple, Ajax’y site that allows you to organize your tasks in different projects:

You can nest tasks and projects, prioritize, tag, colorize, and set absolute and recurring due dates. The interface is dead-simple and very quick. In the three years that I’ve been using the site, there’s only been a few moments of downtime. It manages hundreds of my tasks (all prioritized!) with ease. I honestly think I worry less these days, knowing that all of my tasks and projects are neatly organized. Yes, I am often slightly OCD.

However, I had a big concern that Todoist, which now stores 100% of my tasks, may disappeared without a trace some day. Luckily, Todoist provides a simple JSON API for retrieving all of your projects and tasks. With this API, I was able to build a simple C# app (TodoistBackup.exe) that does daily backups of my Todoist data, just in case Todoist were to ever disappear unexpectedly. (What to do with the data is another question entirely, but I’m sure I could deal with a text file until I found the time to write a replacement… 🙂 ).

The program I created is called TodoistBackup. I am utilizing a C# library from James Newton-King called Json.NET to interface with todoist.com’s API, and save the output into XML. The program is dead simple to use: you simply specify your API “token” (basically a unique ID for each login, so you don’t have to share your username/password), and the output XML file name. For example, this command line saves my tasks to an XML file with today’s date:

TodoistBackup.exe [api token] "tasks-%date:~10,4%%date:~4,2%%date:~7,2%.xml"

The XML looks like this:

<todoist>
    <projects>
        <project Id="1" UserId="2" Name="Fun">
            <items>
                <item Id="1" UserId="2" ProjectId="1" Content="Have fun" />
                ...
            </items>
        </project>
        ...
    </projects>
</todoist>

The conversion from JSON to a XML archival format is incredibly easy in C# using JsonSerializer and XmlSerializer attributes. Check out how nice this is:

    /// <summary>
    /// Todoist project
    /// </summary>
    [JsonObject(MemberSerialization.OptIn)]
    [XmlRootAttribute(ElementName = "project")]
    public class TodoistProject
    {
        /// <summary>
        /// Initializes a new instance of the TodoistProject class.
        /// </summary>
        public TodoistProject()
        {
            Items = new List<TodoistItem>();
        }

        /// <summary>
        /// Gets or sets the project's Id
        /// </summary>
        /// <value>Project's Id</value>
        [JsonProperty("id")]
        [XmlAttribute]
        public int Id
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the user's Id
        /// </summary>
        /// <value>User's Id number</value>
        [JsonProperty("user_id")]
        [XmlAttribute]
        public int UserId
        {
            get;
            set;
        }

Very clean!

The program and source code for TodoistBackup is available on Github. If you have any suggestions, find bugs, or want to contribute, please head there.

Let me know if you use it!

Share this: