rsshub
Version:
Make RSS Great Again!
37 lines (36 loc) • 963 B
JavaScript
import { t as rofetch } from "./ofetch-U0CdpE2g.mjs";
import { t as cache_default } from "./cache-C1Y-9qDV.mjs";
import { t as parser } from "./rss-parser-Dx_OGbNh.mjs";
import { load } from "cheerio";
//#region lib/routes/archdaily/home.ts
const route = {
path: "/",
categories: ["blog"],
example: "/archdaily",
parameters: {},
name: "Home",
maintainers: ["kt286"],
handler
};
async function handler() {
const feed = await parser.parseURL("https://feeds.feedburner.com/ArchdailyCN");
const items = await Promise.all(feed.items.map((item) => cache_default.tryGet(item.link, async () => {
const response = await rofetch(item.link);
const $ = load(response);
return {
title: item.title,
description: $("#single-content").html(),
pubDate: item.pubDate,
link: item.link,
author: item.author
};
})));
return {
title: feed.title,
link: feed.link,
description: feed.description,
item: items
};
}
//#endregion
export { route };