Skip to main content

@idiomark/adapter-reddit

Reddit adapter for Idiomark (Personality Compression Protocol). Extracts user personality data from Reddit including posts, comments, upvotes, and subreddit activity.

Features​

  • User Profile: Bio, karma stats, account metadata
  • Posts: Titles, content, upvotes, comments from submitted posts
  • Comments: Threaded discussions with depth and context
  • Upvoted Content: Shows user interests and preferences
  • Subreddit Activity: Communities the user engages with

Authentication​

Uses OAuth 2.0 with Bearer token.

import { RedditAdapter } from '@idiomark/adapter-reddit'

const adapter = new RedditAdapter({
accessToken: 'your_access_token',
username: 'optional_username'
})

await adapter.authenticate()

Rate Limits​

Reddit enforces rate limits:

  • 60 requests per minute (authenticated)
  • Headers: x-ratelimit-remaining, x-ratelimit-reset

The adapter automatically handles rate limiting with exponential backoff.

Usage​

// Fetch all user data
const content = await adapter.fetchData({
limit: 100,
startDate: new Date('2024-01-01'),
endDate: new Date('2024-12-31'),
includeReplies: true
})

// Extract raw text for analysis
const { rawContent, metadata } = await adapter.extractRawText({ limit: 100 })

Data Types​

TypeDescription
profileUser profile and karma stats
postReddit posts with titles, content, and metrics
commentComments with thread depth and replies
subredditSubreddit metadata and descriptions
upvotedContent upvoted by user (shows interests)

API Documentation​

License​

MIT