Initial commit

This commit is contained in:
Akshay Kolli
2026-02-08 02:32:45 -05:00
commit 3f72118348
26 changed files with 6355 additions and 0 deletions

23
app/api/rss/route.ts Normal file
View File

@@ -0,0 +1,23 @@
import { NextResponse } from 'next/server';
import Parser from 'rss-parser';
export const dynamic = 'force-dynamic';
export async function GET() {
const parser = new Parser();
try {
const feed = await parser.parseURL('https://news.ycombinator.com/rss');
const items = feed.items.slice(0, 10).map(item => ({
title: item.title,
link: item.link,
pubDate: item.pubDate,
creator: item.creator || 'Unknown',
contentSnippet: item.contentSnippet,
}));
return NextResponse.json(items);
} catch (error) {
return NextResponse.json({ error: 'Failed to parse RSS' }, { status: 500 });
}
}