← 返回
未分类

weather-broadcast

This skill enables WorkBuddy to fetch real-time weather data and generate formatted weather broadcast reports for any city. It should be used when users ask about current weather conditions, weather forecasts, or request a weather broadcast/report for a specific city (e.g., "今天北京天气怎么样", "帮我播报上海的天气", "未来3天广州天气预报", "生成一份早间天气播报"). Supports brief summaries, detailed forecasts, and broadcast-style formatted reports. Uses wttr.in as the free weather data source (no API key required).
This skill enables WorkBuddy to fetch real-time weather data and generate formatted weather broadcast reports for any city. It should be used when users ask about current weather conditions, weather forecasts, or request a weather broadcast/report for a specific city (e.g., "今天北京天气怎么样", "帮我播报上海的天气", "未来3天广州天气预报", "生成一份早间天气播报"). Supports brief summaries, detailed forecasts, and broadcast-style formatted reports. Uses wttr.in as the free weather data source (no API key required).
user_29c69ebc
未分类 community v1.0.2 3 版本 100000 Key: 无需
★ 1
Stars
📥 46
下载
💾 0
安装
3
版本
#latest

概述

Weather Broadcast Skill

This skill fetches real-time weather data and generates weather broadcast reports using the free wttr.in API (no API key required).

Trigger Scenarios

Use this skill when users say things like:

  • "今天北京天气怎么样?"
  • "帮我播报一下上海的天气"
  • "未来三天广州天气预报"
  • "生成一份早间/晚间天气播报"
  • "深圳现在什么天气"
  • "明天会下雨吗"(需指定城市)

Workflow

Step 1: Identify the City

Extract the target city from the user's message.

  • If the city is in Chinese, convert it to English/pinyin for the API query (refer to references/weather_api.md for common city name mappings).
  • If no city is specified, ask the user: "请问您要查询哪个城市的天气?"

Step 2: Determine Output Format

Choose the output format based on user intent:

User IntentFormat Flag
-------------------------
Quick check / one-liner--format brief
Detailed forecast, multiple days--format detailed
Broadcast / formal report--format broadcast (default)

Determine forecast days:

  • Default: --days 3
  • If user mentions "今天" only: --days 1
  • If user mentions "一周" / "7天": --days 7

Step 3: Run the Fetch Script

Execute the weather fetcher script:

python "C:\Users\zghui\.workbuddy\skills\weather-broadcast\scripts\fetch_weather.py" <CityName> --days <1|3|7> --format <brief|detailed|broadcast>

Examples:

# Brief current weather
python "..." Beijing --days 1 --format brief

# 3-day detailed forecast
python "..." Shanghai --days 3 --format detailed

# Full broadcast report (default)
python "..." Guangzhou --days 3 --format broadcast

Step 4: Present the Result

  • Display the script output directly in the response.
  • If the weather data indicates extreme conditions (heavy rain, storm, typhoon, extreme heat/cold), add a brief safety reminder.
  • Optionally offer: "需要查询其他城市或更详细的天气信息吗?"

Error Handling

  • Network timeout / connection error: Inform the user that wttr.in may be temporarily unavailable. Suggest checking network or retrying. Do NOT silently fail.
  • Unknown city: The API may return data for a similar city; verify the result makes sense for the requested city.
  • Script not found: The script is at C:\Users\zghui\.workbuddy\skills\weather-broadcast\scripts\fetch_weather.py. Verify the path if errors occur.

Reference Files

  • references/weather_api.md: API documentation, city name mappings, field descriptions, and fallback data sources.
  • scripts/fetch_weather.py: Weather data fetcher script (Python 3, no external dependencies).

Tips

  • The wttr.in API is free and requires no authentication — use it directly.
  • For Chinese cities, use English transliteration (e.g., "Chengdu" not "成都") in the API call.
  • The broadcast format (--format broadcast) produces the most visually appealing output for display.
  • Weather data is retrieved in real-time; there is no caching.

版本历史

共 3 个版本

  • v1.0.2 Initial release 当前
    2026-05-22 13:39 安全 安全
  • v1.0.1 Initial release
    2026-05-22 13:26 安全 安全
  • v1.0.0 Initial release
    2026-05-22 13:24 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

life-service

Sonoscli

steipete
控制Sonos音箱(发现/状态/播放/音量/分组)
★ 55 📥 84,942
life-service

healthcheck

stellarhold170nt
使用 JSON 文件存储追踪饮水和睡眠
★ 11 📥 29,980
life-service

Caldav Calendar

asleep123
使用 vdirsyncer + khal 同步并查询 CalDAV 日历(iCloud、Google、Fastmail、Nextcloud 等)。适用于 Linux。
★ 243 📥 30,514