Add /sync_x command with X bookmarks import flow

This commit is contained in:
TheGeneralist 2026-02-17 20:33:28 +01:00
parent 79073b7a2c
commit 874f3ec570
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
8 changed files with 975 additions and 2 deletions

View file

@ -30,3 +30,21 @@ user_id = "/run/agenix/readlater-user-id"
```toml
user_id = { file = "/run/agenix/readlater-user-id" }
```
### `sync_x`
`/sync_x` imports X/Twitter bookmarks into Read Later.
- The bot prompts for the Cloudflare cookie header string (`auth_token` + `ct0`).
- It runs `isolate_cookies.py`, then `main.py --mode a`.
- Extracted URLs are prepended to Read Later.
- Temporary `creds.txt` / `bookmarks.txt` files are removed after import.
Config example:
```toml
[sync_x]
source_project_path = "/Users/thegeneralist/personal/bookkeeper/vendor/extract-x-bookmarks"
work_dir = "/var/lib/readlater-bot/sync-x"
python_bin = "/Users/thegeneralist/personal/extract-x-bookmarks/.venv/bin/python"
```