hk-weather
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFetch live Hong Kong weather data from HKO Open Data API for: $ARGUMENTS
通过HKO Open Data API获取香港实时天气数据,支持以下参数:$ARGUMENTS
Step 1: Parse Arguments
步骤1:解析参数
Split by spaces into tokens. Separate into keywords and language:
$ARGUMENTS- Language tokens: (English),
en(Traditional Chinese, default),tc(Simplified Chinese) — if found, use asscparameter. Default:langtc - Keywords (case-insensitive):
- → detailed mode (all stations + forecast)
detail - → all station readings only
stations - → 9-day forecast mode
forecast - → warnings mode
warning - → hourly rainfall mode
rainfall - → fetch everything
all - No keywords → default mode: quick weather summary
将按空格分割为多个标记,区分关键词和语言:
$ARGUMENTS- 语言标记:(英文)、
en(繁体中文,默认)、tc(简体中文)——如果匹配到,将其作为sc参数使用。默认值:langtc - 关键词(不区分大小写):
- → 详细模式(包含所有站点数据+预报)
detail - → 仅获取所有站点观测数据
stations - → 9天预报模式
forecast - → 天气预警模式
warning - → 每小时降雨量模式
rainfall - → 获取全部数据
all - 无关键词 → 默认模式:快速天气摘要
Step 1b: Natural Language Intent Detection
步骤1b:自然语言意图识别
Only run this step if no mode keyword was matched in Step 1.
If contains no recognized keyword (step 1 set no mode), check the full raw string for intent patterns. Check in priority order — the first matching pattern wins. Language tokens (, , ) must still be extracted first in Step 1, before this check runs.
$ARGUMENTS$ARGUMENTSentcsc仅当步骤1中未匹配到任何模式关键词时,才执行此步骤。
如果中未包含可识别的关键词(步骤1未设置任何模式),则检查完整的原始字符串是否符合意图模式。按优先级顺序检查——第一个匹配的模式生效。在执行此检查前,必须先在步骤1中提取语言标记(、、)。
$ARGUMENTS$ARGUMENTSentcscIntent Pattern Matching
意图模式匹配
-
Rain intent → set mode toif
rain_querycontains any of:$ARGUMENTS- Chinese: ,
落雨,下雨,會唔會落,會不會落,有冇雨,有沒有雨,幾時落雨,幾時下雨,落雨機會,下雨機會,降雨雨勢 - English (case-insensitive): ,
rain,raining,rainfall,will it rain,going to rain,chance of rainprecipitation
- Chinese:
-
Forecast intent → set mode toif
forecastcontains any of:$ARGUMENTS- Chinese: ,
預報,天氣預測,未來天氣,9天,九天,幾天天氣,下星期天氣,本週天氣,下週天氣,天氣展望,明天天氣,後天天氣預計天氣 - English (case-insensitive): ,
forecast,9-day,9 day,nine day,next week weather,this week weather,tomorrow weather,weather tomorrow,weather outlookcoming days
- Chinese:
-
Temperature intent → set mode toif
stationscontains any of:$ARGUMENTS- Chinese: ,
氣溫,幾度,溫度,熱唔熱,凍唔凍,係唔係熱,係唔係凍,好熱,好凍,熱嗎,凍嗎,天氣熱,天氣凍現時溫度 - English (case-insensitive): ,
temperature,how hot,how cold,temp,degrees,celsius,warm today,cold today,is it hotis it cold
- Chinese:
-
UV intent → set mode toif
stationscontains any of:$ARGUMENTS- Chinese: ,
紫外線,UV,曬,防曬,紫外UV指數 - English (case-insensitive): ,
uv,ultraviolet,uv index,sun protectionsunburn
- Chinese:
-
Humidity intent → set mode toif
stationscontains any of:$ARGUMENTS- Chinese: ,
濕度,潮濕,幾濕,濕唔濕濕嗎 - English (case-insensitive): ,
humidity,humid,how humidmoisture
- Chinese:
-
Typhoon intent → set mode toif
warningcontains any of:$ARGUMENTS- Chinese: ,
颱風,台風,風球,幾號風球,掛幾號,打風,熱帶氣旋,風暴,強風警告颶風 - English (case-insensitive): ,
typhoon,tropical cyclone,signal,wind signal,t8,t3,no.8,no. 8,typhoon signalstorm signal
- Chinese:
-
Warning intent → set mode toif
warningcontains any of:$ARGUMENTS- Chinese: ,
警告,有冇警告,有沒有警告,黃色,紅色,黑色,暴雨警告,雷暴,霜凍水浸 - English (case-insensitive): ,
warning,alert,red rain,black rain,yellow rain,thunderstorm warningfrost warning
- Chinese:
If no pattern matched → set mode to default.
-
降雨意图 → 如果包含以下任一内容,将模式设置为
$ARGUMENTS:rain_query- 中文:,
落雨,下雨,會唔會落,會不會落,有冇雨,有沒有雨,幾時落雨,幾時下雨,落雨機會,下雨機會,降雨雨勢 - 英文(不区分大小写):,
rain,raining,rainfall,will it rain,going to rain,chance of rainprecipitation
- 中文:
-
预报意图 → 如果包含以下任一内容,将模式设置为
$ARGUMENTS:forecast- 中文:,
預報,天氣預測,未來天氣,9天,九天,幾天天氣,下星期天氣,本週天氣,下週天氣,天氣展望,明天天氣,後天天氣預計天氣 - 英文(不区分大小写):,
forecast,9-day,9 day,nine day,next week weather,this week weather,tomorrow weather,weather tomorrow,weather outlookcoming days
- 中文:
-
气温意图 → 如果包含以下任一内容,将模式设置为
$ARGUMENTS:stations- 中文:,
氣溫,幾度,溫度,熱唔熱,凍唔凍,係唔係熱,係唔係凍,好熱,好凍,熱嗎,凍嗎,天氣熱,天氣凍現時溫度 - 英文(不区分大小写):,
temperature,how hot,how cold,temp,degrees,celsius,warm today,cold today,is it hotis it cold
- 中文:
-
紫外线意图 → 如果包含以下任一内容,将模式设置为
$ARGUMENTS:stations- 中文:,
紫外線,UV,曬,防曬,紫外UV指數 - 英文(不区分大小写):,
uv,ultraviolet,uv index,sun protectionsunburn
- 中文:
-
湿度意图 → 如果包含以下任一内容,将模式设置为
$ARGUMENTS:stations- 中文:,
濕度,潮濕,幾濕,濕唔濕濕嗎 - 英文(不区分大小写):,
humidity,humid,how humidmoisture
- 中文:
-
台风意图 → 如果包含以下任一内容,将模式设置为
$ARGUMENTS:warning- 中文:,
颱風,台風,風球,幾號風球,掛幾號,打風,熱帶氣旋,風暴,強風警告颶風 - 英文(不区分大小写):,
typhoon,tropical cyclone,signal,wind signal,t8,t3,no.8,no. 8,typhoon signalstorm signal
- 中文:
-
预警意图 → 如果包含以下任一内容,将模式设置为
$ARGUMENTS:warning- 中文:,
警告,有冇警告,有沒有警告,黃色,紅色,黑色,暴雨警告,雷暴,霜凍水浸 - 英文(不区分大小写):,
warning,alert,red rain,black rain,yellow rain,thunderstorm warningfrost warning
- 中文:
如果没有匹配到任何模式 → 设置为默认模式。
Step 2: Fetch Data
步骤2:获取数据
Base URL:
https://data.weather.gov.hk/weatherAPI/opendata/IMPORTANT — parallel fetching: When a mode requires multiple endpoints, fetch them ALL in a single Bash command using background processes () and . Write each response to a temp file, then read them all. This avoids slow sequential tool calls.
&wait基础URL:
https://data.weather.gov.hk/weatherAPI/opendata/重要提示——并行获取:当某个模式需要调用多个接口时,使用后台进程()和命令,在单个Bash命令中同时获取所有接口数据。将每个响应写入临时文件,之后统一读取。这样可以避免缓慢的串行调用。
&waitDefault Mode — quick summary (single endpoint):
默认模式——快速摘要(单接口):
bash
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=flw&lang={lang}"Key fields: , , , ,
generalSituationforecastPeriodforecastDescoutlookupdateTimebash
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=flw&lang={lang}"关键字段:, , , ,
generalSituationforecastPeriodforecastDescoutlookupdateTimeStations Mode — all station readings (single endpoint):
站点模式——所有站点观测数据(单接口):
bash
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=rhrread&lang={lang}"Key fields: (place, value), (place, value), (place, max, min), , , ,
temperature.data[]humidity.data[]rainfall.data[]uvindexiconwarningMessageupdateTimebash
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=rhrread&lang={lang}"关键字段:(地点、数值), (地点、数值), (地点、最大值、最小值), , , ,
temperature.data[]humidity.data[]rainfall.data[]uvindexiconwarningMessageupdateTimeDetail Mode — fetch two in parallel:
详细模式——并行获取两个接口:
bash
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=rhrread&lang={lang}" > /tmp/hko_rhrread.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=flw&lang={lang}" > /tmp/hko_flw.json &
wait
echo "===RHRREAD===" && cat /tmp/hko_rhrread.json && echo ""
echo "===FLW===" && cat /tmp/hko_flw.json && echo ""
rm -f /tmp/hko_rhrread.json /tmp/hko_flw.jsonbash
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=rhrread&lang={lang}" > /tmp/hko_rhrread.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=flw&lang={lang}" > /tmp/hko_flw.json &
wait
echo "===RHRREAD===" && cat /tmp/hko_rhrread.json && echo ""
echo "===FLW===" && cat /tmp/hko_flw.json && echo ""
rm -f /tmp/hko_rhrread.json /tmp/hko_flw.jsonForecast Mode — 9-day forecast (single endpoint):
预报模式——9天预报(单接口):
bash
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=fnd&lang={lang}"Key fields: — each has , , , , , , , , ,
weatherForecast[]forecastDateweekforecastWeatherforecastMaxtemp.valueforecastMintemp.valueforecastMaxrh.valueforecastMinrh.valueforecastWindPSRForecastIconbash
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=fnd&lang={lang}"关键字段: —— 每个对象包含, , , , , , , , ,
weatherForecast[]forecastDateweekforecastWeatherforecastMaxtemp.valueforecastMintemp.valueforecastMaxrh.valueforecastMinrh.valueforecastWindPSRForecastIconWarnings Mode — fetch both in parallel:
预警模式——并行获取两个接口:
bash
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=warnsum&lang={lang}" > /tmp/hko_warnsum.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=warningInfo&lang={lang}" > /tmp/hko_warninfo.json &
wait
echo "===WARNSUM===" && cat /tmp/hko_warnsum.json && echo ""
echo "===WARNINGINFO===" && cat /tmp/hko_warninfo.json && echo ""
rm -f /tmp/hko_warnsum.json /tmp/hko_warninfo.jsonwarningInfodetails[]contents[]warningStatementCodesubtypeupdateTimebash
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=warnsum&lang={lang}" > /tmp/hko_warnsum.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=warningInfo&lang={lang}" > /tmp/hko_warninfo.json &
wait
echo "===WARNSUM===" && cat /tmp/hko_warnsum.json && echo ""
echo "===WARNINGINFO===" && cat /tmp/hko_warninfo.json && echo ""
rm -f /tmp/hko_warnsum.json /tmp/hko_warninfo.jsonwarningInfodetails[]contents[]warningStatementCodesubtypeupdateTimeRainfall Mode — hourly rainfall (single endpoint):
降雨量模式——每小时降雨量(单接口):
bash
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/hourlyRainfall.php?lang={lang}"Key fields: , — each has , ,
obsTimehourlyRainfall[]automaticWeatherStationvalueunitbash
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/hourlyRainfall.php?lang={lang}"关键字段:, —— 每个对象包含, ,
obsTimehourlyRainfall[]automaticWeatherStationvalueunitAll Mode — fetch all endpoints in parallel:
全量模式——并行获取所有接口:
bash
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=rhrread&lang={lang}" > /tmp/hko_rhrread.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=warnsum&lang={lang}" > /tmp/hko_warnsum.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=flw&lang={lang}" > /tmp/hko_flw.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=fnd&lang={lang}" > /tmp/hko_fnd.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=warningInfo&lang={lang}" > /tmp/hko_warninfo.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/hourlyRainfall.php?lang={lang}" > /tmp/hko_rainfall.json &
wait
echo "===RHRREAD===" && cat /tmp/hko_rhrread.json && echo ""
echo "===WARNSUM===" && cat /tmp/hko_warnsum.json && echo ""
echo "===FLW===" && cat /tmp/hko_flw.json && echo ""
echo "===FND===" && cat /tmp/hko_fnd.json && echo ""
echo "===WARNINGINFO===" && cat /tmp/hko_warninfo.json && echo ""
echo "===RAINFALL===" && cat /tmp/hko_rainfall.json && echo ""
rm -f /tmp/hko_rhrread.json /tmp/hko_warnsum.json /tmp/hko_flw.json /tmp/hko_fnd.json /tmp/hko_warninfo.json /tmp/hko_rainfall.jsonbash
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=rhrread&lang={lang}" > /tmp/hko_rhrread.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=warnsum&lang={lang}" > /tmp/hko_warnsum.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=flw&lang={lang}" > /tmp/hko_flw.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=fnd&lang={lang}" > /tmp/hko_fnd.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=warningInfo&lang={lang}" > /tmp/hko_warninfo.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/hourlyRainfall.php?lang={lang}" > /tmp/hko_rainfall.json &
wait
echo "===RHRREAD===" && cat /tmp/hko_rhrread.json && echo ""
echo "===WARNSUM===" && cat /tmp/hko_warnsum.json && echo ""
echo "===FLW===" && cat /tmp/hko_flw.json && echo ""
echo "===FND===" && cat /tmp/hko_fnd.json && echo ""
echo "===WARNINGINFO===" && cat /tmp/hko_warninfo.json && echo ""
echo "===RAINFALL===" && cat /tmp/hko_rainfall.json && echo ""
rm -f /tmp/hko_rhrread.json /tmp/hko_warnsum.json /tmp/hko_flw.json /tmp/hko_fnd.json /tmp/hko_warninfo.json /tmp/hko_rainfall.jsonRain Query Mode — fetch three in parallel:
降雨查询模式——并行获取三个接口:
bash
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=rhrread&lang={lang}" > /tmp/hko_rhrread.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=flw&lang={lang}" > /tmp/hko_flw.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=fnd&lang={lang}" > /tmp/hko_fnd.json &
wait
echo "===RHRREAD===" && cat /tmp/hko_rhrread.json && echo ""
echo "===FLW===" && cat /tmp/hko_flw.json && echo ""
echo "===FND===" && cat /tmp/hko_fnd.json && echo ""
rm -f /tmp/hko_rhrread.json /tmp/hko_flw.json /tmp/hko_fnd.jsonbash
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=rhrread&lang={lang}" > /tmp/hko_rhrread.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=flw&lang={lang}" > /tmp/hko_flw.json &
curl -s "https://data.weather.gov.hk/weatherAPI/opendata/weather.php?dataType=fnd&lang={lang}" > /tmp/hko_fnd.json &
wait
echo "===RHRREAD===" && cat /tmp/hko_rhrread.json && echo ""
echo "===FLW===" && cat /tmp/hko_flw.json && echo ""
echo "===FND===" && cat /tmp/hko_fnd.json && echo ""
rm -f /tmp/hko_rhrread.json /tmp/hko_flw.json /tmp/hko_fnd.jsonError Handling
错误处理
After each curl response, check:
- If curl itself fails → report "Failed to reach HKO API" and continue to next endpoint
- If response is empty, null, or not valid JSON → report "No data available for {dataType}" and continue
- Always continue processing remaining endpoints if one fails
每次curl请求后,检查以下内容:
- 如果curl请求本身失败 → 报告“无法连接HKO API”,并继续处理下一个接口
- 如果响应为空、null或不是有效的JSON → 报告“{dataType}暂无可用数据”,并继续处理
- 即使某个接口失败,也必须继续处理剩余的接口
Step 3: Present Results
步骤3:展示结果
Default Mode Output (quick summary)
默认模式输出(快速摘要)
undefinedundefined香港天氣概況
香港天氣概況
更新時間: {updateTime}
概況: {generalSituation}
預報 ({forecastPeriod}): {forecastDesc}
展望: {outlook}
- Omit `generalSituation` line if empty
- Keep it compact — no tables, no section headers beyond the title更新時間: {updateTime}
概況: {generalSituation}
預報 ({forecastPeriod}): {forecastDesc}
展望: {outlook}
- 如果`generalSituation`为空,则省略该行
- 保持内容简洁——除标题外,不使用表格和额外的章节标题Rain Query Mode Output
降雨查询模式输出
If is non-empty, display it prominently at the very top.
rhrread.warningMessageFor Traditional Chinese (tc/sc):
undefined如果不为空,将其突出显示在最顶部。
rhrread.warningMessage繁体中文/简体中文(tc/sc):
undefined降雨情況
降雨情況
{if warningMessage: show as highlighted alert}
更新時間: {updateTime from rhrread}
目前降雨:
{if any rainfall.data[].max > 0:}
| 地點 | 雨量 (mm) |
|---|---|
| {place} | {max} |
| ... | ... |
{else:}
各區目前無錄得雨量
今日降雨概率: {fnd.weatherForecast[0].PSR}
預報: {flw.forecastDesc}
展望: {flw.outlook}
資料來源:香港天文台
**For English (en):**
{如果有warningMessage:以高亮提示显示}
更新時間: {来自rhrread的updateTime}
目前降雨:
{如果存在rainfall.data[].max > 0的记录:}
| 地點 | 雨量 (mm) |
|---|---|
| {place} | {max} |
| ... | ... |
{否则:}
各區目前無錄得雨量
今日降雨概率: {fnd.weatherForecast[0].PSR}
預報: {flw.forecastDesc}
展望: {flw.outlook}
資料來源:香港天文台
**英文(en):**
Rain Status
Rain Status
{if warningMessage: show as highlighted alert}
Updated: {updateTime from rhrread}
Current Rainfall:
{if any rainfall.data[].max > 0:}
| Station | Rainfall (mm) |
|---|---|
| {place} | {max} |
| ... | ... |
{else:}
No rainfall currently recorded across stations
Today's Rain Probability: {fnd.weatherForecast[0].PSR}
Forecast: {flw.forecastDesc}
Outlook: {flw.outlook}
Source: Hong Kong Observatory
**Error handling for rain query mode:**
- If `rhrread` fails → omit Current Rainfall section, continue
- If `flw` fails → omit Forecast and Outlook sections, continue
- If `fnd` fails → omit Today's Rain Probability line silently, continue
- If any section is omitted due to failure, still show other data and attribution line{如果有warningMessage:以高亮提示显示}
Updated: {来自rhrread的updateTime}
Current Rainfall:
{如果存在rainfall.data[].max > 0的记录:}
| Station | Rainfall (mm) |
|---|---|
| {place} | {max} |
| ... | ... |
{否则:}
No rainfall currently recorded across stations
Today's Rain Probability: {fnd.weatherForecast[0].PSR}
Forecast: {flw.forecastDesc}
Outlook: {flw.outlook}
Source: Hong Kong Observatory
**降雨查询模式错误处理:**
- 如果`rhrread`请求失败 → 省略“目前降雨”部分,继续处理
- 如果`flw`请求失败 → 省略“预报”和“展望”部分,继续处理
- 如果`fnd`请求失败 → 静默省略“今日降雨概率”行,继续处理
- 如果某部分因请求失败被省略,仍需显示其他可用数据和来源说明行Stations Mode Output
站点模式输出
undefinedundefined目前天氣
目前天氣
更新時間: {updateTime}
- Show temperature for all stations in a table
- Show humidity as a compact list
- For rainfall, only mention stations with max > 0. If all zero, say "各區無顯著雨量"
- If UV index data exists, show it
- If `warningMessage` is non-empty, show it prominently at the top更新時間: {updateTime}
- 以表格形式展示所有站点的气温数据
- 以紧凑列表形式展示湿度数据
- 降雨量仅展示max>0的站点,如果所有站点均为0,则显示“各區無顯著雨量”
- 如果存在UV指数数据,展示该数据
- 如果`warningMessage`不为空,将其突出显示在最顶部Detail Mode Output
详细模式输出
Show warning messages (from ) if non-empty, then current conditions with all stations, then forecast.
rhrread.warningMessageundefined如果不为空,先显示该预警信息,然后展示所有站点的当前天气状况,最后显示预报内容。
rhrread.warningMessageundefined香港天氣概況
香港天氣概況
更新時間: {updateTime from rhrread}
undefined更新時間: {来自rhrread的updateTime}
undefinedCurrent Conditions
当前天气状况
undefinedundefined目前天氣
目前天氣
| 地點 | 氣溫 (°C) |
|---|---|
| {place} | {value} |
| ... | ... |
相對濕度: {humidity place}: {value}%
降雨: {list any places with non-zero rainfall}
- Show temperature for all stations in a table
- Show humidity as a compact list (typically fewer stations)
- For rainfall, only mention stations with max > 0. If all zero, say "各區無顯著雨量"
- If UV index data exists, show it
- If `warningMessage` has content, display it prominently at the top| 地點 | 氣溫 (°C) |
|---|---|
| {place} | {value} |
| ... | ... |
相對濕度: {humidity地点}: {value}%
降雨: {列出所有降雨量非零的地点}
- 以表格形式展示所有站点的气温数据
- 以紧凑列表形式展示湿度数据(通常站点数量较少)
- 降雨量仅展示max>0的站点,如果所有站点均为0,则显示“各區無顯著雨量”
- 如果存在UV指数数据展示该数据
- 如果`warningMessage`不为空,将其突出显示在最顶部Forecast Section
预报章节
undefinedundefined天氣預報
天氣預報
預報時段: {forecastPeriod}
{forecastDesc}
展望: {outlook}
If `generalSituation` is non-empty, show it before the forecast description.預報時段: {forecastPeriod}
{forecastDesc}
展望: {outlook}
如果`generalSituation`不为空,在预报描述前展示该内容。Forecast Mode Output (9-day)
预报模式输出(9天)
undefinedundefined9天天氣預報
9天天氣預報
更新時間: {updateTime}
| 日期 | 星期 | 天氣 | 氣溫 (°C) | 濕度 (%) | 風向 | 降雨概率 |
|---|---|---|---|---|---|---|
| {MM/DD} | {week} | {forecastWeather} | {min}-{max} | {minrh}-{maxrh} | {forecastWind} | {PSR} |
| ... |
undefined更新時間: {updateTime}
| 日期 | 星期 | 天氣 | 氣溫 (°C) | 濕度 (%) | 風向 | 降雨概率 |
|---|---|---|---|---|---|---|
| {MM/DD} | {week} | {forecastWeather} | {min}-{max} | {minrh}-{maxrh} | {forecastWind} | {PSR} |
| ... |
undefinedWarnings Mode Output
预警模式输出
undefinedundefined天氣警告詳情
天氣警告詳情
更新時間: {updateTime}
If no warnings active:目前沒有任何天氣警告。
If warnings exist, for each warning in `warningInfo.details[]`:更新時間: {updateTime}
如果没有生效的预警:目前沒有任何天氣警告。
如果存在预警,针对`warningInfo.details[]`中的每个预警:{warningStatementCode} {subtype if present}
{warningStatementCode} {如果有subtype则显示}
{contents joined by newlines}
更新: {updateTime}
Also show summary table from `warnsum`:| 警告 | 狀態 | 發出時間 |
|---|---|---|
| {name} | {actionCode} | {issueTime} |
undefined{将contents用换行符连接}
更新: {updateTime}
同时展示来自`warnsum`的摘要表格:| 警告 | 狀態 | 發出時間 |
|---|---|---|
| {name} | {actionCode} | {issueTime} |
undefinedRainfall Mode Output
降雨量模式输出
undefinedundefined過去一小時雨量
過去一小時雨量
觀測時間: {obsTime}
| 站點 | 雨量 (mm) |
|---|---|
| {automaticWeatherStation} | {value} |
| ... |
- Filter out stations where `value` is `0` — unless ALL stations are 0, then show all with a note "各區過去一小時無錄得雨量"
- If `value` is `"M"` (maintenance), show as "維修中"
- Sort by rainfall amount descending (highest first)觀測時間: {obsTime}
| 站點 | 雨量 (mm) |
|---|---|
| {automaticWeatherStation} | {value} |
| ... |
- 过滤掉`value`为`0`的站点——除非所有站点均为0,此时显示所有站点并附加说明“各區過去一小時無錄得雨量”
- 如果`value`为`"M"`(维护中),显示为“維修中”
- 按降雨量从高到低排序All Mode Output
全量模式输出
Combine all sections in this order:
- Warnings (if any)
- Current conditions
- Local forecast
- 9-day forecast
- Hourly rainfall
按以下顺序组合所有章节:
- 预警信息(如果有)
- 当前天气状况
- 本地预报
- 9天预报
- 每小时降雨量
Formatting Rules
格式规则
- Attribution: Always append a source line at the end of ALL output, after all sections:
- tc/sc:
_資料來源:香港天文台_ - en:
_Source: Hong Kong Observatory_
- tc/sc:
- Temperatures: display as returned (integer or 1 decimal), with °C
- Humidity: integer, with %
- Rainfall: integer, mm
- Times: convert ISO 8601 timestamps to human-readable HKT format (e.g.
YYYY-MM-DD HH:MM HKT→2026-03-22T02:45:00+08:00)2026-03-22 02:45 HKT - 9-day forecast dates: convert to
YYYYMMDDformatMM/DD - Omit null/empty fields silently — do not show placeholder text for missing data
- Use the language matching for section headers (tc/sc → Chinese headers as shown above; en → English headers like "Current Weather", "9-Day Forecast", etc.)
lang
- 来源标注:在所有输出的末尾,必须添加来源行:
- tc/sc:
_資料來源:香港天文台_ - en:
_Source: Hong Kong Observatory_
- tc/sc:
- 气温:按返回值展示(整数或1位小数),附带°C
- 湿度:整数,附带%
- 降雨量:整数,单位mm
- 时间:将ISO 8601时间戳转换为易读的HKT格式(例如
YYYY-MM-DD HH:MM HKT→2026-03-22T02:45:00+08:00)2026-03-22 02:45 HKT - 9天预报日期:将转换为
YYYYMMDD格式MM/DD - 静默省略null/空字段——不为缺失的数据显示占位文本
- 章节标题使用与匹配的语言(tc/sc → 使用上述中文标题;en → 使用英文标题如"Current Weather", "9-Day Forecast"等)
lang
Rules
规则
- Read-only — only GET requests, never POST/PUT/DELETE
- Always use for silent mode
curl -s - Default language is (Traditional Chinese)
tc - If one endpoint fails, still process all remaining endpoints
- All HKO timestamps are in HKT (+08:00) — convert to format
YYYY-MM-DD HH:MM HKT - When presenting in English mode, use English section headers accordingly
- 只读 —— 仅使用GET请求,禁止使用POST/PUT/DELETE
- 始终使用以静默模式执行
curl -s - 默认语言为(繁体中文)
tc - 即使某个接口失败,仍需处理所有剩余接口
- 所有HKO时间戳均为HKT时区(+08:00)——转换为格式
YYYY-MM-DD HH:MM HKT - 当使用英文模式时,对应使用英文章节标题