I had originally thought to spend another week on the MLO Parser front end.
I wanted to really get an elegant abstraction of the division of labor between the parser guts — which presumably would be independent of output and dependent only on input — and the app itself, which might use the input data to generate XML for updating MLO views on multiple platforms, for example, or might use the data, as in the current use case, to port the data over from MLO to Todoist.
But, as Einstein said, “If you are out to describe the truth, leave elegance to the tailor.” I thought it over, and I thought better of it.
In the first place, I’ll learn the most about the various use cases for the MLO input data by actually working the cases rather than by mulling about them in the abstract.
Plus I know that, left to its own devices, my mind over-abstracts. There’s an old FORTH cartoon I love (which I couldn’t find online) showing a device labeled “Processor” with a keyboard, a “system unit”, and a bowl. On the front of the device is a three-way switch which says “DATA/WORD/FOOD”.
That’s where I was headed.
So, to ground myself, to gain experience with one definite use case, and to actually get closer to my goal instead of messing around, I’m going to focus this week on parser output for Todoist from the MLO data.
There are a bunch of sub-problems here:
- Generating the actual bytes that Todoist needs as input. These are mostly in JSON, so
- Dig in to the JSON library in Go
- Todoist makes a distinction between “projects” which are higher in the hierarchy and tasks which are lower. Projects are allowed to have sub-projects up to four levels and Tasks are allowed to have sub-tasks up to four levels, so I have to somehow split my lovely MLO hierarchies into higher-level “projects” (with multiple levels) and each project ultimately owning a bunch of “tasks” with sub-tasks.
- Set up a streaming connection to the todoist sync server to load the data
- Regulate the flow of the data so that it doesn’t overload the server (or, what is the same thing, break any of the server’s load-throttling rules).
Should be fun.