UNPKG

rsshub

Version:
36 lines (35 loc) 934 B
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs"; import { t as cache_default } from "./cache-CiDoUSLo.mjs"; import { t as parser } from "./rss-parser-Dv4dw4PQ.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 $ = load(await rofetch(item.link)); 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 };