summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md46
1 files changed, 46 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..3fa3017
--- /dev/null
+++ b/README.md
@@ -0,0 +1,46 @@
+# Todoist Repeater
+
+I use Todoist as my todo app. I add tasks to my Inbox, sorted descending by date added. However, repeating tasks in Todoist don't work with my workflow: they stay in a fixed position in the list, and just refresh the due date.
+
+What I want is a task that appears on a given interval, disappears when it's completed, and, when it's time to do it again, reappears at the top of the list.
+
+Some examples of tasks that I want to recurr in this way:
+
+- each weekday, do a given number of Pomodoros for work
+- every day, practice my dance choreography for 15 minutes
+- every Monday evening, take out the garbage, recycling, and compost
+- every two weeks, wash my bedding
+- every six months, wash and condition the leather sofa
+- every three months, do a reflection on how I'm feeling about work
+
+The idea for this program is to:
+
+- have a list of tasks that specifies the task name and the recurrence (interval, start and end date)
+- when it's time to add a task to Todoist, use the Todoist API to create the task in my inbox
+
+Here's the API documentation: https://developer.todoist.com/api/v1/
+
+- I can probably get away with not implementing OAuth, and just using an access token
+- Creating tasks: https://developer.todoist.com/api/v1/#tag/Tasks/operation/create_task_api_v1_tasks_post (simple because pretty much all I want is the task name)
+
+The hard part is how to specify the input file and recurrence mechanism.
+
+There are some interesting considerations:
+
+- if we somehow weren't running when we should have created a task, should we do so later?
+- should we track when we created a task so we don't do it twice somehow?
+- how can we handle reloading the input file?
+- is DST dangerous?
+
+Seems like https://github.com/robfig/cron is the most popular scheduler, and it doesn't have any dependencies, which I like.
+
+So, here's what I have in mind:
+
+At program start, and every minute thereafter:
+
+- read the input file line by line
+- if we've seen a line before, do nothing
+- if we have not seen it, add the line to the hash of seen lines; then, add it to the scheduler
+- if there were any lines that we did not see during this read of the file, but that we saw previously, remove them from the scheduler
+
+The lines will be formatted like a cron file, but instead of a command, we will simply have the name of the task to be created. \ No newline at end of file