Publisher and RSS
Publishers are a separate user type from admins. They have limited dashboard access focused on managing their RSS feed.
Publisher API Endpoints
Section titled “Publisher API Endpoints”| Method | Path | Access | Purpose |
|---|---|---|---|
POST | /api/v1/publisher | Admin | Create a publisher account |
GET | /api/v1/publisher | Admin | List all publishers |
GET | /api/v1/publisher/:id | Admin | Get publisher detail |
PUT | /api/v1/publisher/:id | Admin | Update publisher |
DELETE | /api/v1/publisher/:id | Admin | Delete publisher |
PUT | /api/v1/publisher/:id/approve | Admin | Approve publisher for RSS polling |
PUT | /api/v1/publisher/:id/disable | Admin | Disable publisher |
GET | /api/v1/publisher/me | Publisher | Get own publisher record |
PUT | /api/v1/publisher/me/feed | Publisher | Save RSS feed URL and default tags |
POST | /api/v1/publisher/me/test-feed | Publisher | Preview feed items before saving |
GET | /api/v1/publisher/reports/monthly | Admin | Monthly article report per publisher |
RSS Ingestion
Section titled “RSS Ingestion”The cron job runs every hour (0 * * * *). It calls fetchAllFeeds() which:
- Queries all publishers with
status: approved - Fetches each publisher’s RSS feed URL using
rss-parser - For each feed item, checks if an article with the same
rssFeedGuidalready exists - If not, saves it as a new article with the publisher’s source attribution
// Deduplication checkconst exists = await Article.findOne({ rssFeedGuid: item.guid });if (exists) continue; // skip — already importedSource Attribution Fields
Section titled “Source Attribution Fields”| Field | Value |
|---|---|
isAggregated | true |
source | Publisher’s display name |
sourceUrl | Original article URL |
publisher | ObjectId reference to the Publisher record |
rssFeedGuid | Unique identifier from the feed item (guid or link) |