UNPKG

rsshub

Version:
42 lines (40 loc) 1.73 kB
import "./dist-Bog6z_OM.mjs"; import "./config-MQ-7ebJ_.mjs"; import "./logger-C4avouvV.mjs"; import "./ofetch-DKl_Ma9g.mjs"; import "./parse-date-r5WDWHno.mjs"; import "./is-worker-DESPicPc.mjs"; import { t as cache_default } from "./cache-SV6W5EPy.mjs"; import "./helpers-Bo4JQYdN.mjs"; import "./got-CO-ndVl2.mjs"; import "./timezone-CA9Huotp.mjs"; import { n as rootUrl, t as fetchItems } from "./util-D2CmfqFs.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 };