rsshub
Version:
Make RSS Great Again!
31 lines (30 loc) • 1.34 kB
JavaScript
import { n as rootUrl, t as fetchItems } from "./util-BbeE3kWu.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(ctx.req.query("limit")) : 30;
const currentUrl = new URL(`top/${category.split(/_/, 1)[0]}_1.html`, rootUrl).href;
return await fetchItems(limit, currentUrl);
}
//#endregion
export { route };