rsshub
Version:
Make RSS Great Again!
58 lines (56 loc) • 1.73 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 { t as parseDate } from "./parse-date-BrP7mxXf.mjs";
import { t as cache_default } from "./cache-Bo__VnGm.mjs";
import "./helpers-DxBp0Pty.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import { load } from "cheerio";
//#region lib/routes/cqgas/tqtz.ts
const url = "http://www.cqgas.cn/portal/article/page?cateId=1082&pageNo=1";
const route = {
path: "/tqtz",
categories: ["forecast"],
example: "/cqgas/tqtz",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["cqgas.cn/"] }],
name: "停气检修通知",
maintainers: ["Mai19930513"],
handler,
url: "cqgas.cn/"
};
async function handler() {
const { data: response } = await got_default(url);
const $ = load(response);
const contentUrl = (id) => `http://www.cqgas.cn/portal/article/content?contentId=${id}`;
const list = $("ul.news_list > li").toArray().map((item) => {
item = $(item);
const title = item.find("a").first();
return {
title: title.text(),
link: contentUrl(title.attr("contentid")),
pubDate: parseDate(item.find("span.right.txt_black2").text())
};
});
return {
title: "重庆燃气——停气检修通知",
link: url,
item: await Promise.all(list.map((item) => cache_default.tryGet(item.link, async () => {
const { data: response$1 } = await got_default(item.link);
item.description = load(response$1)("body > div").first().html();
return item;
})))
};
}
//#endregion
export { route };