UNPKG

rsshub

Version:
74 lines (72 loc) 2.33 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 "./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 path from "node:path"; //#region lib/routes/ff14/ff14-zh.ts init_esm_shims(); const route = { path: ["/zh/:type?", "/ff14_zh/:type?"], categories: ["game"], example: "/ff14/zh/news", parameters: { type: "分类名,预设为 `all`" }, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["ff.web.sdo.com/web8/index.html"], target: "/zh" }], name: "最终幻想 14 国服", maintainers: [ "Kiotlin", "ZeroClad", "15x15G" ], handler, url: "ff.web.sdo.com/web8/index.html", description: `| 新闻 | 公告 | 活动 | 广告 | 所有 | | ---- | -------- | ------ | --------- | ---- | | news | announce | events | advertise | all |` }; async function handler(ctx) { const referer = "https://ff.sdo.com/web8/index.html"; const data = (await got_default({ method: "get", url: `http://api.act.sdo.com/UnionNews/List?gameCode=ff&category=${{ news: "5310", announce: "5312", events: "5311", advertise: "5313", all: "5310,5312,5311,5313,5309" }[ctx.req.param("type") ?? "all"]}&pageIndex=0&pageSize=50`, headers: { Referer: referer } })).data.Data; return { title: "最终幻想14(国服)新闻中心", link: referer + "#/newstab/newslist", description: "《最终幻想14》是史克威尔艾尼克斯出品的全球经典游戏品牌FINAL FANTASY系列的最新作品,IGN获得9.2高分!全球累计用户突破1600万!", item: data.map(({ Title, Summary, Author, PublishDate, HomeImagePath }) => ({ title: Title, link: Author, description: art(path.join(__dirname, "templates/description-fc190f49.art"), { image: HomeImagePath, description: Summary }), pubDate: timezone(parseDate(PublishDate), 8) })) }; } //#endregion export { route };