Skip to main content
Glama

MCP-RSS-Crawler

by mshk
formatter.ts1.23 kB
import dbManager from '../db-manager'; import type { FeedItem, FeedResponse } from './types'; /** * Convert database items to feed items format */ export function convertDbItemsToFeedItems(dbItems: any[]): FeedItem[] { return dbItems.map(item => { // Get categories for this item const categories = dbManager.getItemCategories(item.id); return { id: item.id, title: item.title, published: item.published, updated: item.updated, summary: { direction: 'ltr', content: item.summary }, author: item.author, categories, origin: { streamId: item.feed_id, title: '', // This will be filled in later if needed htmlUrl: '' }, alternate: [{ href: item.link, type: 'text/html' }] }; }); } /** * Format feed items into a feed response */ export function formatFeedResponse(items: FeedItem[], title: string, id: string, description: string): FeedResponse { return { direction: "ltr", id, title, description, self: { href: "/api/feeds" }, updated: Math.floor(Date.now() / 1000), updatedUsec: Date.now().toString() + "000", items }; }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mshk/mcp-rss-crawler'

If you have feedback or need assistance with the MCP directory API, please join our Discord server