From bd255cc03f73d6bb6d30de51f906f3e7e990be1b Mon Sep 17 00:00:00 2001 From: Sven Date: Wed, 18 Mar 2026 23:01:16 +0100 Subject: [PATCH] docs: document YouTube likes store integration and draft behavior - Update sync flow diagram to show store.createFile step - Note draft status and "Title - Author" content format - Add reset route to routes table Co-Authored-By: Claude Opus 4.6 --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a9720ef6..fce33884 100644 --- a/README.md +++ b/README.md @@ -326,13 +326,17 @@ First sync after connecting: Every subsequent sync (hourly background + manual trigger): YouTube API → fetch liked videos → compare against youtubeLikesSeen ↓ new like found (not in seen set) - Insert into youtubeLikesSeen + create "like" post in posts collection + Mark as seen → generate markdown via publication.postTemplate() + → write file to GitHub store via store.createFile() + → insert post document into MongoDB posts collection ↓ already seen Skip ``` Only likes added **after** the initial connection produce posts. Existing likes (e.g. 200 historical ones) are baselined without generating posts. +Like posts are created as **drafts** (`post-status: draft` → `draft: true` in Eleventy frontmatter) with content `Video Title - Channel Name`. The markdown file is committed to the GitHub `blog` repo via `@indiekit/store-github`, following the same flow as Micropub-created posts (postTemplate → store.createFile). Reset also deletes files from the store. + ### OAuth 2.0 setup The YouTube Data API requires OAuth 2.0 (not just an API key) to access a user's liked videos. @@ -358,6 +362,7 @@ The YouTube Data API requires OAuth 2.0 (not just an API key) to access a user's | `GET /youtube/likes/callback` | No | OAuth callback (Google redirects here) | | `POST /youtube/likes/disconnect` | Yes | Removes stored tokens | | `POST /youtube/likes/sync` | Yes | Triggers manual sync | +| `POST /youtube/likes/reset` | Yes | Deletes all like posts (GitHub + MongoDB), seen IDs, baseline | | `GET /youtube/api/likes` | No | Public JSON API (`?limit=N&offset=N`) | ### MongoDB collections