rsshub
Version:
Make RSS Great Again!
51 lines (49 loc) • 1.4 kB
JavaScript
import "./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 "./cache-Bo__VnGm.mjs";
import { n as fetchNewsItems, t as fetchCategory } from "./utils-BQonf03P.mjs";
//#region lib/routes/iplaysoft/category.ts
const handler = async (ctx) => {
const slug = ctx.req.param("slug");
const { id, name } = await fetchCategory(slug);
const rootUrl = "https://www.iplaysoft.com/";
const items = await fetchNewsItems(`${rootUrl}wp-json/wp/v2/posts?_embed&categories=${id}`);
return {
title: `${name} - 异次元软件世界`,
description: "软件改变生活",
language: "zh-CN",
link: `${rootUrl}category/${slug}`,
item: items
};
};
const route = {
path: "/category/:slug",
name: "分类",
url: "www.iplaysoft.com",
maintainers: ["cscnk52"],
handler,
example: "/iplaysoft/category/system",
parameters: { slug: "分类名称" },
description: void 0,
categories: ["program-update"],
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportRadar: true,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{
source: ["www.iplaysoft.com/category/:slug"],
target: "/category/:slug"
}],
view: ViewType.Articles
};
//#endregion
export { handler, route };