feat: add Reddit connector (saved + upvoted)#81
Merged
Conversation
New @spool-lab/connector-reddit package exporting two connectors: - reddit-saved — posts and comments you saved - reddit-upvoted — posts you upvoted Uses cookies:chrome to reuse the logged-in Reddit session and hits old.reddit.com's JSON API (session cookie works directly, no bearer token needed). Handles both t3 (posts) and t1 (comments) kinds, paginates via the Reddit `after` cursor, respects forward-sync anchors, and maps 429/5xx/401 to the standard SyncErrorCodes with backoff. Registered in landing registry.json for spool://install/ flow. Not bundled — users install via the connectors directory or CLI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8c21c80 to
e47809d
Compare
Spool's cookies capability uses a suffix-match (LIKE '%.') against cookie host_key, so querying 'https://www.reddit.com' builds the pattern '%.www.reddit.com' and misses the actual cookies which are scoped to '.reddit.com' (the apex). Query the apex directly to match. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
@spool-lab/connector-redditas a new plugin exporting two connectors:Both are persistent (
ephemeral: false) user-owned lists.Approach
cookies:chrome— reuses the user's logged-in Reddit session. Same pattern as twitter-bookmarks / xiaohongshu.old.reddit.com's JSON API. Old Reddit accepts thereddit_sessioncookie directly — no OAuth bearer token needed./api/me.jsonand cached per connector instance.aftercursor, 100 items/page.t3(posts) andt1(comments)kinds. Filters Reddit's thumbnail sentinel strings (self,default,nsfw, etc.).AUTH_SESSION_EXPIRED(invalidates cached session).sinceItemIdanchor, consistent with github-stars.Capabilities declared
fetch,cookies:chrome,log— matches twitter-bookmarks.Distribution
Not bundled — users install via
spool://connector/install/@spool-lab/connector-redditor the connectors directory. Added topackages/landing/public/registry.json.Known limitations / follow-ups
src/fetch.tsis structurally identical to twitter-bookmarks'graphql-fetch.ts. With two copies now, it's probably time to promote a sharedfetchJsonWithRetryhelper into@spool/connector-sdk. Deliberately left out of this PR to keep scope tight — will do as a refactor once a third consumer appears or in its own PR.Test plan
pnpm --filter @spool-lab/connector-reddit build— clean tscpnpm build— full workspace turbo build passes🤖 Generated with Claude Code