Closed AlJohri closed 8 months ago
Hello and sorry for late response. You can solve this task with simple curl+jq in bash:
#!/bin/bash
# extract cookie named "t" from ticktick in browser, this is long string, about
# 300 symbols
TICK_COOKIE='154B...'
curl 'https://api.ticktick.com/api/v2/batch/check/0' \
-H 'accept: application/json, text/plain, */*' \
-H "cookie: t=$TICK_COOKIE" \
--compressed \
| jq '.syncTaskBean.update.[] ' \
| jq '{title, content, dueDate}' \
| jq 'select(.dueDate != null)'
# or merge all jq's to one command:
# | jq '.syncTaskBean.update.[] | {title, content, dueDate} | select(.dueDate != null)'
Output example:
$ ./script.sh
{
"title": "task name/title there",
"content": "task description/content there",
"dueDate": "2023-09-15T21:00:00.000+0000"
}
{
"title": "one more task",
"content": null,
"dueDate": "2023-09-15T21:00:00.000+0000"
}
Play with jq output format, process fields, filter. Do anything you want. This is very easy :D
This is EXACTLY what I want to do. Thank you! This is great!
I really need the project names too. I have the ProjectIds but no correpsonding names. Do you perhaps know how pull that list of IDs and Names out of the API?
curl -s 'https://api.ticktick.com/api/v2/projects' - working on the jq command to pull out "id" and "name"
I understand no future work is planned, but I wanted to throw a feature request out there to see if you are interested in adding this to
ticked
.I would like a simple CLI for
ticktick
to get a list of my tasks for today. This will make it easy to integrate with tools like Übersicht to create macOS desktop widgets.Do you think something like this is in scope for
ticked
?