UNPKG

rsshub

Version:
40 lines (38 loc) 1.18 kB
import "./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 "./helpers-DxBp0Pty.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import { t as renderHTML } from "./utils-D5OliN_I.mjs"; //#region lib/routes/gocn/news.ts const route = { path: ["/", "/news"], name: "Unknown", maintainers: ["AtlanCI", "CcccFz"], handler, url: "gocn.vip/" }; async function handler() { const base_url = "https://gocn.vip/c/3lQ6GbD5ny/home"; const article_url = "https://gocn.vip/c/3lQ6GbD5ny"; return { title: `GoCN社区-最新动态`, link: base_url, description: `获取GoCN站点最新动态`, item: (await got_default({ url: "https://gocn.vip/api/home/page", headers: { Referer: base_url } })).data.data.articlePageList.list.map((item) => ({ title: item.name, link: `${article_url}/s/${item.spaceGuid}/d/${item.guid}`, description: renderHTML(JSON.parse(item.content)), pubDate: parseDate(item.ctime, "X"), author: item.nickname })) }; } //#endregion export { route };