-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
phase-aPhase A: Foundation + RedditPhase A: Foundation + RedditsocialSocial platform monitoringSocial platform monitoringswarm-readyIssue is ready for the automated swarm to pick upIssue is ready for the automated swarm to pick up
Description
Summary
Implement the Reddit social platform adapter as the first social monitoring integration.
Details
Create packages/social-reddit/ implementing SocialPlatformAdapter:
- Auth: OAuth 2.0 client credentials flow (app-only). User provides Reddit app client ID and secret.
- Search: Uses Reddit JSON API (
/search.json) with queries:url:example.com— find link posts sharing the domain"brand keyword"— find text mentions
- Rate limits: 100 req/min with OAuth (very generous)
- Cost: Free
- Data extracted: Post title, body, score, comment count, upvote ratio, subreddit, author, permalink, creation time
Package structure
packages/social-reddit/
src/adapter.ts -- implements SocialPlatformAdapter
src/normalize.ts -- Reddit API response → SocialMentionResult[]
src/types.ts -- Reddit API response types
src/index.ts -- re-exports
test/index.test.ts
package.json -- @ainyc/canonry-social-reddit
tsconfig.json
tsup.config.ts
vitest.config.ts
Depends on
- Social contracts issue
Acceptance Criteria
- Adapter validates config (requires clientId + clientSecret)
- Healthcheck verifies Reddit API connectivity
-
searchMentions()returns normalizedSocialMentionResult[] - Deduplication by
external_id - Unit tests with mocked Reddit API responses
-
pnpm run typecheckandpnpm run testpass
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
phase-aPhase A: Foundation + RedditPhase A: Foundation + RedditsocialSocial platform monitoringSocial platform monitoringswarm-readyIssue is ready for the automated swarm to pick upIssue is ready for the automated swarm to pick up