UNPKG

rsshub

Version:
52 lines (50 loc) 1.71 kB
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 path from "node:path"; //#region lib/routes/gov/guangdong/tqyb/tfxtq.ts init_esm_shims(); const rootUrl = "http://www.tqyb.com.cn"; const route = { path: "/guangdong/tqyb/tfxtq", categories: ["forecast"], example: "/gov/guangdong/tqyb/tfxtq", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["www.tqyb.com.cn/gz/weatherAlarm/suddenWeather/"] }], name: "突发性天气提示", maintainers: ["Fatpandac"], handler, url: "www.tqyb.com.cn/gz/weatherAlarm/suddenWeather/" }; async function handler() { const tfxtqJsUrl = `${rootUrl}/data/gzWeather/weatherTips.js`; const response = await got_default.get(tfxtqJsUrl); return { title: "突发性天气提示", link: "http://www.tqyb.com.cn/gz/weatherAlarm/suddenWeather/", item: JSON.parse(`[{${response.data.match(/Tips = {(.*?)}/)[1]}}]`).map((item) => ({ title: item.title, link: "http://www.tqyb.com.cn/gz/weatherAlarm/suddenWeather/", author: item.issuer, description: art(path.join(__dirname, "templates/tfxtq-6c6d1a10.art"), { content: item.content }), pubDate: parseDate(item.ddate), guid: parseDate(item.ddate) + item.title })) }; } //#endregion export { route };