@idiomark/adapter-mastodon
Mastodon adapter for Idiomark (Personality Compression Protocol). Extracts user personality data from Mastodon and the Fediverse including toots, replies, boosts, and favorites.
Features
- User Profile: Bio, fields, follower counts, verification status
- Toots: Posts with content, media, and metadata
- Boosts: Shared content showing interests
- Favorites: Liked content showing preferences
- Replies: Threaded conversations with context
Authentication
Uses OAuth 2.0 Bearer token authentication.
import { MastodonAdapter } from '@idiomark/adapter-mastodon'
const adapter = new MastodonAdapter({
accessToken: 'your_access_token',
instance: 'mastodon.social', // or any Mastodon instance
username: 'optional_username'
})
await adapter.authenticate()
Rate Limits
Mastodon rate limits vary by instance:
- Typically 300 requests per 5 minutes
- Headers:
x-ratelimit-remaining,x-ratelimit-reset
The adapter automatically handles rate limiting with 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
| Type | Description |
|---|---|
profile | User profile with bio and fields |
toot | Posts with content, media, and engagement |
favorite | Liked posts showing preferences |
boost | Reblogged posts showing amplification |
Fediverse Support
This adapter works with any Mastodon-compatible instance:
- mastodon.social
- fosstodon.org
- mastodon.online
- And 1000+ more instances
API Documentation
License
MIT