rsshub
Version:
Make RSS Great Again!
43 lines (41 loc) • 1.76 kB
JavaScript
import "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import "./parse-date-BrP7mxXf.mjs";
import { t as cache_default } from "./cache-Bo__VnGm.mjs";
import "./helpers-DxBp0Pty.mjs";
import "./render-BQo6B4tL.mjs";
import "./got-KxxWdaxq.mjs";
import "./timezone-D8cuwzTY.mjs";
import { n as rootUrl, t as fetchItems } from "./util-DGF4XA_q.mjs";
//#region lib/routes/56kog/top.ts
const route = {
path: "/top/:category?",
categories: ["reading"],
example: "/56kog/top/weekvisit",
parameters: { category: "分类,见下表,默认为周点击榜" },
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
name: "榜单",
maintainers: ["nczitzk"],
handler,
description: `| [周点击榜](https://www.56kog.com/top/weekvisit.html) | [总收藏榜](https://www.56kog.com/top/goodnum.html) | [最新 入库](https://www.56kog.com/top/postdate.html) |
| ---------------------------------------------------- | -------------------------------------------------- | ---------------------------------------------------- |
| weekvisit | goodnum | postdate |`
};
async function handler(ctx) {
const { category = "weekvisit" } = ctx.req.param();
const limit = ctx.req.query("limit") ? Number.parseInt(ctx.req.query("limit"), 10) : 30;
const currentUrl = new URL(`top/${category.split(/_/)[0]}_1.html`, rootUrl).href;
return await fetchItems(limit, currentUrl, cache_default.tryGet);
}
//#endregion
export { route };