UNPKG

rsshub

Version:
26 lines (23 loc) 917 B
import { t as parseDate } from "./parse-date-BrP7mxXf.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import { load } from "cheerio"; //#region lib/routes/8kcos/article.ts async function loadArticle(link) { const article = load((await got_default(link)).body); const entryChildren = article("div.entry-content").children(); const imgs = entryChildren.find("noscript").toArray().map((e) => e.children[0].data); const txt = entryChildren.slice(2).toArray().map((e) => load(e).html()); return { title: article(".entry-title").text(), description: [...imgs, ...txt].join(""), pubDate: parseDate(article("time")[0].attribs.datetime), link }; } var article_default = loadArticle; //#endregion //#region lib/routes/8kcos/const.ts const SUB_NAME_PREFIX = "8KCosplay"; const SUB_URL = "https://www.8kcosplay.com/"; //#endregion export { SUB_URL as n, article_default as r, SUB_NAME_PREFIX as t };