rsshub
Version:
Make RSS Great Again!
57 lines (55 loc) • 1.7 kB
JavaScript
import { n as init_esm_shims, t as __dirname } from "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import { t as ViewType } from "./types-D84BRIt4.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import "./helpers-DxBp0Pty.mjs";
import { t as art } from "./render-BQo6B4tL.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import path from "node:path";
import { load } from "cheerio";
//#region lib/routes/ps/monthly-games.ts
init_esm_shims();
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"
};
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: art(path.join(__dirname, "templates/monthly-games-df9e124a.art"), {
img: item.find(".media-block__img source").attr("srcset"),
text: item.find("h3 + p").text()
}),
link: item.find(".btn--cta").attr("href")
};
})
};
}
//#endregion
export { route };