UNPKG

rsshub

Version:
18 lines (16 loc) 756 B
import { t as ofetch_default } from "./ofetch-BIyrKU3Y.mjs"; import { t as parseDate } from "./parse-date-BrP7mxXf.mjs"; import * as cheerio from "cheerio"; //#region lib/routes/qstheory/utils.ts const baseUrl = "http://www.qstheory.cn"; const getItem = async (item) => { const response = await ofetch_default(item.link); const $ = cheerio.load(response); $(".fs-text, .fs-pinglun, .hidden-xs").remove(); item.author = $(".appellation").text(); item.description = $(".highlight, .text").html() || $(".content").html(); item.pubDate = parseDate($(".puttime_mobi, .pubtime, .headtitle span").text().trim().replace("发表于", "").replaceAll(/(年|月)/g, "-").replace("日", "")); return item; }; //#endregion export { getItem as n, baseUrl as t };