UNPKG

rsshub

Version:
67 lines (65 loc) 2.3 kB
import "./dist-Bog6z_OM.mjs"; import "./config-MQ-7ebJ_.mjs"; import "./logger-C4avouvV.mjs"; import "./ofetch-DKl_Ma9g.mjs"; import { t as parseDate } from "./parse-date-r5WDWHno.mjs"; import "./helpers-Bo4JQYdN.mjs"; import { t as got_default } from "./got-CO-ndVl2.mjs"; import { t as timezone } from "./timezone-CA9Huotp.mjs"; import { Fragment, jsx, jsxs } from "hono/jsx/jsx-runtime"; import { renderToString } from "hono/jsx/dom/server"; //#region lib/routes/gov/guangdong/tqyb/sncsyjxh.tsx 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: renderToString(/* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsxs("text", { children: [ "地区: ", item.cname, " " ] }), /* @__PURE__ */ jsx("br", {}), /* @__PURE__ */ jsxs("text", { children: [ "等级: ", item.sigtypename, " " ] }), /* @__PURE__ */ jsx("br", {}), /* @__PURE__ */ jsxs("text", { children: ["发布时间:", item.datetime] }) ] })), 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 };