rsshub
Version:
Make RSS Great Again!
44 lines (42 loc) • 1.39 kB
JavaScript
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 { t as got_default } from "./got-CO-ndVl2.mjs";
import { i as apiMomentRootUrl, l as processItems, s as fetchData, u as rootUrl } from "./util-B64gnjsQ.mjs";
//#region lib/routes/huxiu/moment.ts
const route = {
path: "/moment",
categories: ["new-media"],
example: "/huxiu/moment",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: true,
supportBT: false,
supportPodcast: true,
supportScihub: false
},
radar: [{ source: ["huxiu.com/moment"] }],
name: "24 小时",
maintainers: ["nczitzk"],
handler,
url: "huxiu.com/moment"
};
async function handler(ctx) {
const limit = ctx.req.query("limit") ? Number.parseInt(ctx.req.query("limit"), 10) : 20;
const apiUrl = new URL("web-v3/moment/feed", apiMomentRootUrl).href;
const currentUrl = new URL("moment", rootUrl).href;
const { data: response } = await got_default.post(apiUrl, { form: { platform: "www" } });
return {
item: await processItems(response.data.moment_list.datalist, limit, cache_default.tryGet),
...await fetchData(currentUrl)
};
}
//#endregion
export { route };