rsshub
Version:
Make RSS Great Again!
38 lines (36 loc) • 1.15 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 "./cache-Bo__VnGm.mjs";
import "./helpers-DxBp0Pty.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import { n as parseList, t as parseItem } from "./utils-Bzn2CzGG.mjs";
//#region lib/routes/guokr/scientific.ts
const route = {
path: "/scientific",
categories: ["new-media"],
example: "/guokr/scientific",
radar: [{ source: ["guokr.com/scientific", "guokr.com/"] }],
name: "科学人",
maintainers: ["alphardex", "nczitzk"],
handler,
url: "guokr.com/scientific"
};
async function handler() {
const { data: response } = await got_default("https://www.guokr.com/beta/proxy/science_api/articles", { searchParams: {
retrieve_type: "by_category",
page: 1
} });
const result = parseList(response);
return {
title: "果壳网 科学人",
link: "https://www.guokr.com/scientific",
description: "果壳网 科学人",
item: await Promise.all(result.map((item) => parseItem(item)))
};
}
//#endregion
export { route };