anydo todoist

Created at 2024-05-07 Updated at 2024-11-07 - 2 min. read

Recently, todoist has removed its support from the google home. It’s is only available to google assistant on android. This has brought me into middle of crisis. As I have a google home that was linked to todoist service. To solve this issue I figured out that there is already any.do that is available for integration with google home. Issue was there was no official support for the API in any.do. Somehow I was able to find out that there is a unofficial library that is available for any.do

So I wrote a small node script which actually runs on every 10 mins and check outs that do I have any new any.do task. If yes, then it moves it to todoist with a specific tag to inbox and then deletes it from anydo.

Below is the code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const Api = require('anydo-api');
const Todoist = require('todoist').v9

const api = new Api('[email protected]', 'password');
const todoist = Todoist('api_key')


async function updateTodo(){
await todoist.sync()
let anyRes = await api.sync();
const new_task = anyRes.models.task.items.filter(t => t.status === 'UNCHECKED');
for(let i = 0; i < new_task.length; i++) {
console.log(new_task[i])
await todoist.items.add({content: new_task[i].title, labels: ['anydo']});
await api.deleteTask({taskId: new_task[i].id});
}
}

updateTodo();

Happy coding!!

Table of Content

Site by Ashutosh Kumar Singh using Hexo & Random

Traveller - Developer - Foodie - Biker - Cyclist - Rider - Technocrat