UNPKG

rsshub

Version:
58 lines (56 loc) 1.95 kB
import "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import { t as ViewType } from "./types-D84BRIt4.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import "./ofetch-BIyrKU3Y.mjs"; import { t as parseDate } from "./parse-date-BrP7mxXf.mjs"; import { t as cache_default } from "./cache-Bo__VnGm.mjs"; import "./helpers-DxBp0Pty.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import { t as timezone } from "./timezone-D8cuwzTY.mjs"; import { load } from "cheerio"; //#region lib/routes/fx678/kx.ts const route = { path: "/kx", categories: ["finance"], view: ViewType.Notifications, example: "/fx678/kx", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["fx678.com/kx"] }], name: "7x24 小时快讯", maintainers: ["occupy5", "dousha"], handler, url: "fx678.com/kx" }; async function handler() { const link = "https://www.fx678.com/kx/"; const $ = load((await got_default.get(link)).data); const list = $(".body_zb ul .body_zb_li .zb_word").find(".list_font_pic > a:first-child").toArray().slice(0, 30).map((e) => $(e).attr("href")); return { title: "7x24小时快讯", link, item: await Promise.all(list.map((itemUrl) => cache_default.tryGet(itemUrl, async () => { const $$1 = load((await got_default.get(itemUrl)).data); const contentPart = $$1(".article-main .content").html().trim(); const forewordPart = $$1(".article-main .foreword").html().trim(); const articlePubDate = timezone(parseDate($$1(".article-cont .details i").text().trim(), "YYYY-MM-DD HH:mm:ss"), 8); return { title: $$1(".article-main .foreword").text().trim().split("——").pop(), link: itemUrl, description: contentPart.length > 1 ? contentPart : forewordPart, pubDate: articlePubDate }; }))) }; } //#endregion export { route };