Todoist.com (and TodoistBackup.exe)

Share

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:

Todoist.com

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!

  1. gpzbc
    June 13th, 2009 at 22:57 | #1

    Thanks for creating this. I love the idea. However, I am having a hard time figuring out how to use the program. Can you offer any advice?
    Sorry to be such a noob.

  2. June 14th, 2009 at 10:05 | #2

    Hi gpzbc. You should be able to just run TodoistBackup.exe with two arguments, your API token (look at your Preferences | Account screen, for “Web service token”), and the output file name:

    TodoistBackup.exe [api token] [output file name]

  3. gpzbc
    June 14th, 2009 at 23:03 | #3

    Ah yes. I figured it out. Thank you very much.

    Like you said, I’m not sure what I would do with this data if Todoist ever disappeared. But it is definitely reassuring to know that I now at least have the text file of all my tasks.

    Thanks again!

  4. L
    July 3rd, 2009 at 21:10 | #4

    It worked great.
    Unfortunately, though, I am even more computer inept than the above poster. I have been trying to figure out how to make this run as a daily task, with the arguments and all, but everything I’ve tried has failed. If you get a chance, could you give me a super-basic run through of how to do such a thing? (I’ve been searching google and trying various solutions, but I’m messing it up somewhere).
    Thanks!

  5. July 6th, 2009 at 07:39 | #5

    Are you using Windows XP or Vista?

    XP: http://support.microsoft.com/kb/308569
    Vista: http://technet.microsoft.com/en-us/appcompat/aa906020.aspx

    You’ll want the command line to be the path to Todoistbackup.exe

    The two arguments are your API token (from Preferences | Account screen in todoist.com), and the output file name.

    i.e.:
    TodoistBackup.exe 1231231-31313123a C:\TodoistBackup.xml

    Hope that helps!

  6. Antonio
    February 6th, 2010 at 05:59 | #6

    Works like a charm. Thanks!

  7. November 28th, 2010 at 02:10 | #7

    Hi!
    I’ve started building on a generic C# class library to wrap the todoist API, you should be able to use this from your application 🙂

    Check it out at http://todoistapi.codeplex.com

  8. November 28th, 2010 at 10:36 | #8

    Nice! Looks like a good class library to base future projects off of.

  1. January 10th, 2012 at 23:17 | #1
  2. October 27th, 2012 at 07:03 | #2