UNPKG

rsshub

Version:
53 lines (51 loc) 1.71 kB
import "./dist-Bog6z_OM.mjs"; import "./config-MQ-7ebJ_.mjs"; import { t as ViewType } from "./types-gOySfSXJ.mjs"; import "./logger-C4avouvV.mjs"; import "./ofetch-DKl_Ma9g.mjs"; import "./helpers-Bo4JQYdN.mjs"; import { t as got_default } from "./got-CO-ndVl2.mjs"; import { Fragment, jsx, jsxs } from "hono/jsx/jsx-runtime"; import { load } from "cheerio"; import { renderToString } from "hono/jsx/dom/server"; //#region lib/routes/ps/monthly-games.tsx const route = { path: "/monthly-games", categories: ["game"], view: ViewType.Notifications, example: "/ps/monthly-games", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["www.playstation.com/en-sg/ps-plus/whats-new"] }], name: "PlayStation Monthly Games", maintainers: ["justjustCC"], handler, url: "www.playstation.com/en-sg/ps-plus/whats-new" }; const renderDescription = (img, text) => renderToString(/* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("img", { src: img }), text] })); async function handler() { const baseUrl = "https://www.playstation.com/en-sg/ps-plus/whats-new/"; const { data: response } = await got_default(baseUrl); const $ = load(response); return { title: "PlayStation Plus Monthly Games", link: baseUrl, item: $("#monthly-games .box--light ").toArray().map((e) => { const item = $(e); return { title: item.find("h3").text(), description: renderDescription(item.find(".media-block__img source").attr("srcset"), item.find("h3 + p").text()), link: item.find(".btn--cta").attr("href") }; }) }; } //#endregion export { route };