rsshub
Version:
Make RSS Great Again!
55 lines (53 loc) • 2 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";
//#region lib/routes/gov/guangdong/tqyb/sncsyjxh.ts
init_esm_shims();
const rootUrl = "http://www.tqyb.com.cn";
const route = {
path: "/guangdong/tqyb/sncsyjxh",
categories: ["forecast"],
example: "/gov/guangdong/tqyb/sncsyjxh",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["www.tqyb.com.cn/gz/weatherAlarm/otherCity/"] }],
name: "广东省内城市预警信号",
maintainers: ["Fatpandac"],
handler,
url: "www.tqyb.com.cn/gz/weatherAlarm/otherCity/"
};
async function handler() {
const sncsyjxhJsUrl = `${rootUrl}/data/gzWeather/otherCityAlarm.js`;
const response = await got_default.get(sncsyjxhJsUrl);
const resData = JSON.parse(String(response.data.match(/Alarm = (.*?);/)[1]));
const data = [];
for (const i in resData) for (const j in resData[i]) data.push(resData[i][j]);
return {
title: "广东省内城市预警信号",
link: `http://www.tqyb.com.cn/gz/weatherAlarm/otherCity/`,
item: data.map((item) => ({
title: item.cname + " " + item.sigtypename,
link: `http://www.tqyb.com.cn/gz/weatherAlarm/otherCity/`,
description: art(path.join(__dirname, "templates/sncsyjxh-e00d18c2.art"), { item }),
pubDate: timezone(parseDate(item.datetime, "YYYY年MM月DD日 HH:mm"), 8),
guid: timezone(parseDate(item.datetime, "YYYY年MM月DD日 HH:mm"), 8) + item.cname + item.sigtypename
}))
};
}
//#endregion
export { route };