This is a fork of zemmyang/Habitica-GoogleTasksSync.
The original maintainer has stopped maintaining the project, so I've forked it for my own use and to make some changes.
I am not sure if I will be able to maintain this project for others, so any pull requests/issues may not be addressed.
Do you like Google Tasks to keep everything in place but also want to level up your character in Habitica? This tool copies all of your Google Tasks to Habitica and checks if any of the GTasks are updated/marked as done and marks the corresponding Habitica todo accordingly.
Limited to 100 tasks per tasklist theoretically, but you'll hit the Google Apps Script runtime limit at that point. Best to limit it at around 50 tasks total (including completed tasks).
-
Download the
*.js
Files:- Download the files from the
src
directory of this repository.
- Download the files from the
-
Rename the Files:
- Rename the downloaded
.js
files to.gs
files.
- Rename the downloaded
-
Create a Google Apps Script Project:
- Go to Google Apps Script.
- Create a new project.
-
Upload the Files:
- Upload, or copy and paste, all the renamed
.gs
files into your Google Apps Script project.
- Upload, or copy and paste, all the renamed
-
Enable the "Tasks API" Service:
- From within the project, select the "+" icon next to "Services".
- Scroll down and add the "Tasks API" service.
-
Configure Script Properties:
- Go to "Project Settings" (gear icon at the right) and populate the "Script Properties" as follows:
habitica_apikey
,habitica_userid
, andhabitica_apiurl
are self-explanatory.delay_in_seconds
forces the script to take a break between requests, so that the Habitica API won't kick you out for making too many requests at a time.gtasks_maxresults
limits the amount of tasks you can get per tasklist in GTasks. You can theoretically increase this number.verbose
makes the log more chatty. Not implemented.
- Go to "Project Settings" (gear icon at the right) and populate the "Script Properties" as follows:
-
Add a Trigger:
- Add a trigger to run
main
on a timer, e.g., every 5 minutes. - From within the project, select the clock icon on the left then the "+ Add Trigger" button on the bottom right.
- Choose which function to run: "main"
- Choose which deployment should run: "Head" (the only option)
- Select event source: "Time-driven"
- Select type of time-based trigger: "Minutes timer" (adjust as desired)
- Select minute interval: "Every 5 minutes" (adjust as desired)
- Add a trigger to run
-
Enable Google Apps Script API:
- Go to Google Apps Script User Settings.
- Ensure the Google Apps Script API is enabled.
-
Clone the Repository:
git clone https://github.com/yourusername/Habitica-GoogleTasksSync.git cd Habitica-GoogleTasksSync
-
Install Dependencies:
npm install
-
Enable Google Apps Script API:
- Go to Google Apps Script User Settings.
- Ensure the Google Apps Script API is enabled.
-
Authenticate Clasp:
npx clasp login
-
Create or Link Your Google Apps Script Project:
- Create a
.clasp.json
file with your project details:{ "scriptId": "your_script_id", "rootDir": "src" }
- Create a
-
Push the Code to Google Apps Script:
npx clasp push
- Does not handle repeating tasks
- Each subtask is imported as a separate task
- The Habitica side does end up looking quite cluttered later on
- Support for repeated tasks
- Use the Task List name as a Habitica tag
- Two-way sync <- serious question, does anyone want this? lmk
- Trigger-based updating on GTasks. That's on Google's side, not me :)
v2.0.0 - Overhauled the code completely.
v1.2.0 - Checklist and tags support.
v1.1.0 - Works in longer testing, now supports up to 100 tasks per task list.
v1.0.0-alpha - Works in testing but not completely tested yet