UNPKG

rsshub

Version:
62 lines (60 loc) 2.1 kB
import { n as init_esm_shims, t as __dirname } from "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import { t as ofetch_default } from "./ofetch-BIyrKU3Y.mjs"; import { t as art } from "./render-BQo6B4tL.mjs"; import path from "node:path"; //#region lib/routes/dushu/fuzhou/index.ts init_esm_shims(); const host = "https://gateway-api-ipv4.dushu365.com/compose-orch/offlineActivity/v100/activity/list"; const itemLink = "https://card.dushu.io/requirement/offline-activity/activity-detail/v/index.html"; const link = "https://card.dushu.io/requirement/offline-activity/host-home/v/index.html?webview-type=rn&hostId=xtntzsnwsnkw511r"; const transformTime = (item) => { const startTime = new Date(item.startTime); item.startTime = `${startTime.getFullYear()}-${startTime.getMonth() + 1}-${startTime.getDate()} ${startTime.getHours()}:${startTime.getMinutes()}`; const endTime = new Date(item.endTime); item.endTime = `${endTime.getFullYear()}-${endTime.getMonth() + 1}-${endTime.getDate()} ${endTime.getHours()}:${endTime.getMinutes()}`; }; const route = { path: "/fuzhou", categories: ["new-media"], example: "/dushu/fuzhou", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["www.dushu365.com*"] }], name: "樊登福州运营中心", maintainers: ["Fatpandac"], handler, url: "www.dushu365.com*" }; async function handler() { const data = (await ofetch_default(host, { method: "POST", body: { channelTid: "xtntzsnwsnkw511r", pageNo: 1, pageSize: 10, type: 0 } })).data.activityListVOS; data.map((element) => transformTime(element)); return { title: "樊登福州运营中心", link, item: data.map((item) => ({ title: item.activityName, link: itemLink + "?productId=" + item.activityId + "&type=" + item.type, description: art(path.join(__dirname, "templates/message-078312f2.art"), { item }) })) }; } //#endregion export { route };