Implement Discourse API client #2

Closed
opened 2026-01-05 21:33:05 -06:00 by b3nw · 0 comments
Owner

Overview

Async HTTP client to fetch user activity and posts from EVE Forums (Discourse).

Tasks

  • Create src/eve_mod/discourse.py
  • Implement DiscourseClient class with cookie auth
  • Fetch user profile: GET /u/{username}.json
  • Fetch user activity: GET /u/{username}/activity.json
  • Fetch full post content: GET /t/{topic_id}.json
  • Filter posts by date range (last N days)
  • Handle pagination for activity feeds
  • Add rate limiting with exponential backoff
  • Handle errors gracefully (user not found, auth failed, etc.)

Data Models

@dataclass
class UserPost:
    post_id: int
    topic_id: int
    topic_title: str
    content: str  # raw/cooked HTML
    created_at: datetime
    url: str

Acceptance Criteria

  • Can fetch posts for a given username
  • Returns list of UserPost objects
  • Respects rate limits
  • Works with cookie authentication
## Overview Async HTTP client to fetch user activity and posts from EVE Forums (Discourse). ## Tasks - [ ] Create `src/eve_mod/discourse.py` - [ ] Implement `DiscourseClient` class with cookie auth - [ ] Fetch user profile: `GET /u/{username}.json` - [ ] Fetch user activity: `GET /u/{username}/activity.json` - [ ] Fetch full post content: `GET /t/{topic_id}.json` - [ ] Filter posts by date range (last N days) - [ ] Handle pagination for activity feeds - [ ] Add rate limiting with exponential backoff - [ ] Handle errors gracefully (user not found, auth failed, etc.) ## Data Models ```python @dataclass class UserPost: post_id: int topic_id: int topic_title: str content: str # raw/cooked HTML created_at: datetime url: str ``` ## Acceptance Criteria - Can fetch posts for a given username - Returns list of UserPost objects - Respects rate limits - Works with cookie authentication
b3nw closed this issue 2026-01-05 21:41:13 -06:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: b3nw/eve-forum-moderator#2