RedPlanetHQ/core

New Integration: Reddit

Offen

#525 geöffnet am 24.02.2026

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (184 Forks)auto 404
enhancementgood first issueintegrationnew-featurenew-integration

Repository-Metriken

Stars
 (1.930 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Description

Add Reddit integration to sync subreddit posts, comments, user activity, and community data into CORE.

Reference Implementations

Existing Integrations (use as templates)

  • integrations/slack/ - Similar social/messaging platform integration
  • integrations/discord/ - Community platform integration
  • integrations/linkedin/ - Social platform integration

Required Files Structure

integrations/reddit/
├── src/
│   ├── index.ts          # Main entry, OAuth spec
│   ├── schedule.ts       # Sync logic
│   ├── utils.ts          # Reddit API utilities
│   ├── account-create.ts # OAuth setup
│   └── create-activity.ts # Activity formatting
├── package.json
├── tsup.config.ts
└── README.md

Reddit API Integration

OAuth Setup

  • Use OAuth 2.0
  • All clients must authenticate with a registered OAuth token
  • Authorization URL: https://www.reddit.com/api/v1/authorize
  • Token URL: https://www.reddit.com/api/v1/access_token
  • Required scopes: read, history, identity, mysubreddits, subscribe
  • Base URL: https://oauth.reddit.com (authenticated requests)

Key Endpoints

  • GET /r/{subreddit}/hot - Hot posts in a subreddit
  • GET /r/{subreddit}/new - New posts in a subreddit
  • GET /r/{subreddit}/top - Top posts in a subreddit
  • GET /r/{subreddit}/comments/{article} - Comments on a post
  • GET /api/v1/me - Current user identity
  • GET /user/{username}/overview - User's posts and comments
  • GET /subreddits/mine/subscriber - User's subscribed subreddits
  • GET /r/{subreddit}/search - Search within a subreddit
  • GET /r/{subreddit}/about - Subreddit information
  • GET /message/inbox - Private messages

Events to Track

  1. Posts - New submissions, post updates, upvotes/downvotes
  2. Comments - New comments, replies, comment threads
  3. Subreddits - Subscribed subreddits, subreddit activity
  4. Messages - Private messages, modmail
  5. User Activity - User posts, comments, karma changes

Implementation Tasks

  • Set up basic integration structure following integrations/github/src/index.ts pattern
  • Implement OAuth 2.0 flow in account-create.ts
  • Create API utilities in utils.ts with Reddit API client
  • Implement sync logic in schedule.ts for posts, comments, subreddits
  • Convert Reddit data to CORE activity format
  • Add error handling and rate limiting (60 requests/minute)
  • Create integration documentation
  • Add to integrations/README.md

Technical Notes

  • REST API with JSON responses
  • OAuth 2.0 required for all authenticated requests
  • Rate limit: 60 requests per minute per OAuth client ID
  • Must set a custom User-Agent header identifying your app
  • Pagination uses after and before fullname-based cursors
  • Reddit API Terms and Data API Terms updated June 2023
  • API access now requires registration and may involve costs
  • Listing endpoints return max 100 items per request
  • Use raw_json=1 parameter to get unescaped JSON

Resources

Labels

enhancement, integration, new-feature

Contributor Guide