UNPKG

rsshub

Version:
46 lines (44 loc) 1.64 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 "./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 art } from "./render-BQo6B4tL.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import { t as timezone } from "./timezone-D8cuwzTY.mjs"; import { t as parseArticle } from "./utils-C-rfUmgL.mjs"; import path from "node:path"; //#region lib/routes/oeeee/app/channel.ts init_esm_shims(); const route = { path: "/app/channel/:id", name: "Unknown", maintainers: ["TimWu007"], handler }; async function handler(ctx) { const id = ctx.req.param("id") ?? 50; const { data: response } = await got_default(`https://api-ndapp.oeeee.com/friends.php?m=Zone&a=SpaceDoclist&uid=${id}&type=doc`); const list = response.data.filter((i) => i.url).map((item) => ({ title: item.title, description: art(path.join(__dirname, "templates/description-6615c3d4.art"), { thumb: item.titleimg.replaceAll(/\?x-oss-process=.*/g, ""), description: item.summary }), pubDate: timezone(parseDate(item.ptime * 1e3), 8), link: item.url, channel: item.author })); const channel = list[1] ? list[1].channel : ""; const items = await Promise.all(list.map((item) => parseArticle(item, cache_default.tryGet))); return { title: `南方都市报客户端 - ${channel}`, link: `https://m.mp.oeeee.com/u/${id}.html`, item: items }; } //#endregion export { route };