Files
captoys/diigo-cache
dckcandClaude Opus 5.5 992e871c56 feat(diigo-cache): refresh each cache every 3 hours
workerd has no cron triggers, but it runs Durable Object alarms, and
the cache DOs already hold their wiring to the webapp: a refresh
scheduled from inside the DO needs no credential outside it (a systemd
timer would need a cache id to call /api with).

A fill that ends (done or failed) sets an alarm 3 hours out; it starts
a fill that refetches every page through the deepest one holding an
item updated in the last 2 days (page 1 at least, where new bookmarks
land). Refetching overwrites pages in place rather than dropping them
first, so a refresh that fails leaves the cache as it was. stopFill now
also stops a finished job's refreshes.

FillStatus gains refetchThrough (optional; additive). Caches whose fill
ended before this get their first refresh alarm when they next wake.

The service starts at boot as well as on the socket: alarms fire only
while workerd runs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 23:31:48 -05:00
..

diigo-cache

Your diigo bookmarks, cached in a workerd worker, with a public page you can filter by week: /public/<you>?in=2026-W41. Your diigo session cookie is stored in one Durable Object and nowhere else.

Getting started

pnpm install
pnpm dev   # → http://localhost:8787/

Then, in the browser:

  1. mint the diigo session at webapp: paste the Cookie header from diigo.com (devtools, any logged-in request).
  2. wire it, mode public. Save the cache id it shows (the password-manager button does this).
  3. open this cache → fill, and watch it walk your bookmarks.
  4. Visit /public/<your diigo username>?days=7.

Bookmarks you hold, a page anyone can read

  • Filter by date and search: ?days=7, ?in=2026-W41 (ISO week, UTC), ?after=2026-01-01&before=2026-02-01, ?by=created, and ?q= with words, "phrases", #tags, -negation, and gmail-style newer_than:7d. Add Accept: application/json for JSON.
  • Private stays private: the public cache drops private bookmarks before storing anything, so it never holds them.
  • Ids are capabilities: the cache id is a bearer key you keep in your password manager. It rides URL fragments and POST bodies, never a path or query string, so it stays out of logs and history.
  • Cheap to read: pages come from Durable Object SQLite storage, and a fill job in the background fetches each diigo page once.

Design and tests: CONTRIBUTING. Running it on bldbox: the operator docs.