Workflowy calendar is a simple tool to synchronize dates from Workflowy to Google Calendar.
- authenticate to workflowy
- create a sample date entry for testing at top level
read a single entry, document metadata - read initialization data to get root node
- parse top level tree from initial data
- find sample item in tree
- authenticate to gcal
- pull list of calendars from API
- pull events from "workflowy" calendar
- publish any event to gcal
- publish sample workflowy event to gcal
- Read all entries
- Search for notes tagged with #calendar and a date
- sync data for event to gcal based on uuid
- if no uuid, create
- if uuid, update if needed]
- Publish all dates to calendar named "workflowy"
- Smart republish: only publish changes
- 2 way sync: read/write data on both ends
- Automate run
There is an unofficial PHP api which seems most supported. there is a python API that looks half implemented. i'm doing this for fun and to experiment with Copilot, so I'm going to use the PHP implementation as API docs and write a Python implementation of the API.
The entire tree is called a project. The id is projectid. Each project has a list
of child projects, listed under ch
in the data structure.
Each project has a server side assigned uuid named id
.
Workflowy uses https to send a username and password as form data
Endpoint: https://workflowy.com/ajax\_login Post data: username, password Result Header: a session cookie Result Body JSON: success: true|false
Endpoint: https://workflowy.com/get\_initialization\_data Post header: session cookie Response: JSON encoded tree struccture
This gets your initial tree, not sure to what depth. It does not appear to have descriptions. 4410c0683221 is what might be displayed in your browser when you focus on a node, and it is the last part of the node id/uuid.
The result is a tree encoded as json.
{
"projectTreeData":
{
"mainProjectTreeInfo":
{
"rootProject": null,
"rootProjectChildren":
[
{
"id": "ed8e78eb-dffc-4128-1a44-c60cda112ee6",
"nm": "Past",
"ct": 97551049,
"metadata": {},
"lm": 100652553,
"ch": []
}
]
}
}
}
{
"id": "d1fb00f8-a095-2483-decd-4410c0683221",
"nm": "<time startYear=\"2023\" startMonth=\"6\" startDay=\"2\">Fri, Jun 2, 2023</time> post this test node to google calendar",
"ct": 100726143,
"metadata": {},
"lm": 100780842
}
- API Zendesk Ticket: https://workflowy.zendesk.com/hc/en-us/community/posts/201100295-API
- PHP: https://github.com/johansatge/workflowy-php
- JS: https://github.com/malcolmocean/opusfluxus
- Python: https://github.com/haaavk/wfapi
This part is going to be a bit arduous. There might be an easier way for a single human to manage their own calendar with scripting but what I've found are instructions to write code against gcal as if you are an app developer.
In your google calendar, create a new calendar called "workflowy".
If you want to use this app to sync your workflowy to gcal, from what i've found so far, you need to do these things.
https://developers.google.com/workspace/guides/create-project
Following the docs, to do this on your own you'll need to create an OAuth client to programatically access your google calendar.
The end result of these few steps are what you save to the .gcal.credentials.json file.
I thought I followed the docs on this before running the script, but on first login if you haven't done this it will pop up a link to enable it.
- Python GCal API: https://developers.google.com/calendar/api/guides/overview
- https://developers.google.com/calendar/api/quickstart/python
- https://developers.google.com/calendar/api/v3/reference/calendarList/list#python
sudo activate-global-python-argcomplete
eval "$(register-python-argcomplete ./proto.py)"
./proto.py -
-h --help --wf-auth --wf-init