rsshub
Version:
Make RSS Great Again!
61 lines (59 loc) • 1.78 kB
JavaScript
import { n as init_esm_shims, t as __dirname } from "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import { t as parseDate } from "./parse-date-BrP7mxXf.mjs";
import "./helpers-DxBp0Pty.mjs";
import { t as art } from "./render-BQo6B4tL.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import { t as timezone } from "./timezone-D8cuwzTY.mjs";
import path from "node:path";
import { load } from "cheerio";
//#region lib/routes/gov/cmse/fxrw.ts
init_esm_shims();
const route = {
path: "/cmse/fxrw",
categories: ["government"],
example: "/gov/cmse/fxrw",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["www.cmse.gov.cn/fxrw"] }],
name: "飞行任务",
maintainers: ["nczitzk"],
handler,
url: "www.cmse.gov.cn/fxrw"
};
async function handler() {
const currentUrl = `http://www.cmse.gov.cn/fxrw/`;
const $ = load((await got_default({
method: "get",
url: currentUrl
})).data);
const items = $("#list li a").toArray().map((item) => {
item = $(item);
return {
title: item.find(".title").text().split(":").pop().trim(),
link: new URL(item.attr("href"), currentUrl).href,
pubDate: timezone(parseDate(item.find(".infoR").first().text().trim(), "YYYY年M月D日H时m分"), 8),
description: art(path.join(__dirname, "templates/description-f9ed8f8b.art"), {
image: new URL(item.find("img").attr("src"), currentUrl).href,
description: item.find(".info").html()
})
};
});
return {
title: $("title").text(),
link: currentUrl,
item: items
};
}
//#endregion
export { route };