UNPKG

rsshub

Version:
16 lines (14 loc) 741 B
import { t as ofetch_default } from "./ofetch-BIyrKU3Y.mjs"; import { t as cache_default } from "./cache-Bo__VnGm.mjs"; import { load } from "cheerio"; //#region lib/routes/mirrormedia/utils.ts function getArticle(item) { return cache_default.tryGet(item.link, async () => { const content = load(await ofetch_default(item.link)); item.description = item.link.includes("external") ? content(":is([class^=external-article-brief],[class^=external-article-content])").html() : content(":is([class^=brief__BriefContainer],[class^=article-content__Wrapper])").html(); item.category = [...item.category, ...(content("meta[name='keywords']").attr("content") ?? "").split(",")]; return item; }); } //#endregion export { getArticle as t };