Files
RSSHub/lib/v2/56kog/class.js
T
Ethan Shen cdc36d3554 feat(route): add 明月中文网 (#14520)
* feat(route): add 明月中文网

* fix: remove 404 items
2024-02-22 21:50:40 +08:00

11 lines
363 B
JavaScript

const { rootUrl, fetchItems } = require('./util');
module.exports = async (ctx) => {
const { category = '1_1' } = ctx.params;
const limit = ctx.query.limit ? Number.parseInt(ctx.query.limit, 10) : 30;
const currentUrl = new URL(`class/${category}.html`, rootUrl).href;
ctx.state.data = await fetchItems(limit, currentUrl, ctx.cache.tryGet);
};