名称: google-weather
描述: Google 天气 API - 准确、实时的天气数据。获取当前天气状况、温度、湿度、风速和预报。由 Google 天气 API 驱动,提供可靠、超本地化的数据,每 15 分钟更新一次。支持全球任意地点。
版本: 1.2.0
作者: Leo 🦁
标签: [天气, google, 预报, 温度, 实时, 当前状况, 气候, 风, 湿度]
元数据: {"clawdbot":{"emoji":"🌤️","requires":{"env":["GOOGLE_API_KEY"]},"primaryEnv":"GOOGLE_API_KEY","secondaryEnv":["GOOGLE_WEATHER_API_KEY","GOOGLE_MAPS_API_KEY"]}}
允许工具: [exec]
使用 Google 天气 API 获取准确的天气状况。需要一个已启用天气 API 的 Google Cloud API 密钥。
# 当前天气(格式化输出)
python3 skills/google-weather/lib/weather_helper.py current "New York"
python3 skills/google-weather/lib/weather_helper.py current "London"
python3 skills/google-weather/lib/weather_helper.py current "Sydney"
# 24小时预报
python3 skills/google-weather/lib/weather_helper.py forecast "Tel Aviv"
# 原始 JSON 数据
python3 skills/google-weather/lib/weather_helper.py json "Paris"
*纽约*
局部多云 ⛅
🌡️ 12°C (体感温度 10°C)
💨 风速: 18 km/h 西北
💧 湿度: 55%
*特拉维夫 24 小时预报*
18:00: 17.8°C, ☀️ 5 km/h 北
22:00: 14.3°C, ☀️ 6 km/h 东北偏东
02:00: 12.8°C, ⛅ 8 km/h 东北
06:00: 10.8°C, ☀️ 6 km/h 东北偏东
10:00: 16.1°C, ☀️ 5 km/h 南
14:00: 20.4°C, 🌤️ 8 km/h 西北偏西
全球任意地点 - 只需输入城市名称:
- New York, London, Paris, Berlin, Sydney
- San Francisco, Berlin, Singapore, Dubai
- 或任何地址、地标或坐标
该技能会自动使用 Google 地图 API 进行地理编码。
GOOGLE_API_KEY 环境变量如果您已配置了
GOOGLE_WEATHER_API_KEY或GOOGLE_MAPS_API_KEY,也支持使用它们。
输出会根据地点自动适配语言 - 支持英语、希伯来语等,基于 language 参数。
# 希伯来语输出
python3 skills/google-weather/lib/weather_helper.py current "Tel Aviv"
# 输出: בהיר ☀️ 19°C...