Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.
/ todoist-habits Public archive

A web service to integrate habit tracking in Todoist

License

Notifications You must be signed in to change notification settings

zchlm/todoist-habits

Repository files navigation

Todoist Habits

An automation to enable habit tracking in Todoist Built with Lumen. Heavily inspired by the Python web service amitness/habitist with two improvements:

  1. Habits are reset when re-scheduled
  2. Support for workday habits

It integrates Seinfield's "Don't Break the Chain" method into Todoist. Once it's setup, you can forget about it and it works seamlessly.

Usage

  1. Add habits you want to form as tasks on Todoist. Habits can either be scheduled for:

    • every day
    • every workday
  2. Add [day 0] to the task

  3. When you complete the task, [day 0] will become [day 1]

  4. If you fail to complete the task and it becomes overdue, the script will schedule it to today and reset [day X] to [day 0]

  5. Habits will also reset if they are re-scheduled

How it works

  1. Scheduled command: This command runs every day and increments [day X] if a habit is complete, otherwise resets

  2. Resetting re-scheduled habits: The application uses Todoist webhooks to listen for updated tasks. If a habit's due date has changed, it will reset

Configuring with Heroku

  1. Fork and clone the repo

    git clone https://github.com/yourgithubusername/todoist-habits
    
  2. Create a Todoist app and obtain an access token. You can either follow their oAuth authorisation flow using curl OR use the provided Test token

  3. Create a Heroku app + install the Heroku Scheduler & Postgres add-ons

    heroku create appname
    heroku addons:create scheduler:standard
    heroku addons:create heroku-postgresql
    
  4. Add the access token, client secret, and timezone

     heroku config:set TODOIST_TOKEN='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
     heroku config:set TODOIST_CLIENT_SECRET='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
     heroku config:set APP_TIMEZONE='PHP_SUPPORTED_TIMEZONE'
    
  5. Push the app to Heroku

    git push heroku master
    
  6. Finally run heroku addons:open scheduler and schedule the command php artisan todoist-habits to run daily at midnight in your timezone

License

This project is licensed under the MIT License - see the LICENSE file for details

About

A web service to integrate habit tracking in Todoist

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages