rsshub
Version:
Make RSS Great Again!
16 lines (15 loc) • 767 B
JavaScript
import { t as rofetch } from "./ofetch-U0CdpE2g.mjs";
import { t as cache_default } from "./cache-C1Y-9qDV.mjs";
import { load } from "cheerio";
//#region lib/routes/mirrormedia/utils.ts
function getArticle(item) {
return cache_default.tryGet(item.link, async () => {
const detailResponse = await rofetch(item.link);
const content = load(detailResponse);
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 };