{"skill":{"slug":"cn-weather","displayName":"中国天气技能 (cn-weather) v1.0.0 发布。  - 提供中国城市天气数据，集成和风天气（QWeather）","summary":"中国天气 API - 使用和風天气 (QWeather) 获取中国城市天气数据。支持双 API（和风天气 + Open-Meteo）。","description":"---\nname: cn-weather\ndescription: \"中国天气 API - 使用和風天气 (QWeather) 获取中国城市天气数据。支持双 API（和风天气 + Open-Meteo）。\"\nhomepage: https://dev.qweather.com/docs/api/\nmetadata: { \"openclaw\": { \"emoji\": \"🌤️\", \"requires\": { \"config\": [\"QWEATHER_API_KEY\"] } } }\n---\n\n# 中国天气技能 (CN Weather)\n\n使用和風天气 (QWeather) API 获取中国城市的实时天气和预报数据。\n\n**✨ 特性：**\n- 🔄 双 API 支持（和风天气 + Open-Meteo 自动降级）\n- 📧 邮件推送\n- 📅 3 天天气预报\n- 🏙️ 多城市支持\n\n---\n\n## 🔐 安全配置说明\n\n### 敏感信息存储位置\n\n**出于安全考虑，所有敏感配置已加密存储：**\n\n- **API Key** → `TOOLS.md`（本地加密存储）\n- **凭据 ID** → `TOOLS.md`（本地加密存储）\n- **邮箱授权码** → `TOOLS.md`（本地加密存储）\n\n**不要** 在技能文件中存储任何敏感信息！\n\n### 配置步骤\n\n1. **编辑 TOOLS.md**\n   ```bash\n   # 使用编辑器打开\n   code TOOLS.md\n   ```\n\n2. **添加配置**（参考示例）\n   ```markdown\n   ### Weather API (和风天气)\n   - **API Key**: `你的 API_KEY`\n   - **凭据 ID**: `你的凭据 ID`\n   \n   ### Email (QQ 邮箱)\n   - **发件人**: `你的邮箱@qq.com`\n   - **授权码**: `你的授权码`\n   ```\n\n3. **保存后自动加载**\n   - 脚本会自动从 TOOLS.md 读取配置\n   - 无需修改技能文件\n\n---\n\n## 🚀 快速使用\n\n### 方式 1: 运行 Python 脚本（推荐）\n\n```bash\n# 使用默认配置\npython scripts/weather_report_v2.py\n\n# 发送到指定邮箱\npython scripts/weather_report_v2.py recipient@example.com\n```\n\n### 方式 2: 从 skill 目录运行\n\n```bash\ncd skills/cn-weather\npython weather_report.py\n```\n\n### 方式 3: PowerShell 命令\n\n```powershell\n# 从 TOOLS.md 读取 API Key 后执行\n$apiKey = \"从 TOOLS.md 读取\"\n(Invoke-WebRequest -Uri \"https://devapi.qweather.com/v7/weather/now?location=101190801&key=$apiKey\" -UseBasicParsing).Content | ConvertFrom-Json\n```\n\n---\n\n## 📁 文件结构\n\n```\nskills/cn-weather/\n├── SKILL.md              # 公开文档（无敏感信息）\n└── weather_report.py     # 执行脚本（从 TOOLS.md 读取配置）\n\nworkspace/\n├── TOOLS.md              # 🔐 敏感配置（本地存储）\n├── scripts/\n│   └── weather_report_v2.py  # 主脚本\n└── docs/\n    └── qweather-*.md     # 相关文档\n```\n\n---\n\n## 🏙️ 常用城市 ID\n\n| 城市 | ID | 省份 | 坐标 |\n|------|-----|------|------|\n| 北京 | 101010100 | 北京 | 39.90°N, 116.41°E |\n| 上海 | 101020100 | 上海 | 31.23°N, 121.47°E |\n| 广州 | 101280101 | 广东 | 23.13°N, 113.27°E |\n| 深圳 | 101280601 | 广东 | 22.54°N, 114.06°E |\n| **连云港 (赣榆)** | **101190801** | 江苏 | 34.83°N, 119.12°E |\n| **宿迁 (宿豫)** | **101191301** | 江苏 | 33.95°N, 118.33°E |\n| 南京 | 101190101 | 江苏 | 32.06°N, 118.78°E |\n| 苏州 | 101190501 | 江苏 | 31.30°N, 120.59°E |\n| 杭州 | 101210101 | 浙江 | 30.27°N, 120.15°E |\n| 成都 | 101270101 | 四川 | 30.67°N, 104.07°E |\n\n---\n\n## 🌤️ 天气代码对照（完整版）\n\n### 晴天\n| 代码 | 含义 | 图标 | 时段 |\n|------|------|------|------|\n| 100 | 晴 | ☀️ | 白天 |\n| 150 | 晴 | 🌙 | 夜晚 |\n\n### 多云\n| 代码 | 含义 | 图标 |\n|------|------|------|\n| 101 | 多云 | ☁️ |\n| 102 | 少云 | ⛅ |\n| 103 | 晴间多云 | 🌤️ |\n| 104 | 阴 | ☁️ |\n| 151-153 | 夜间 variant | 🌙 |\n\n### 雨\n| 代码 | 含义 | 图标 |\n|------|------|------|\n| 300-301 | 阵雨/强阵雨 | 🌦️🌧️ |\n| 302-304 | 雷阵雨 | ⛈️ |\n| 305-309 | 小雨/中雨/大雨 | 🌧️ |\n| 310-318 | 暴雨及以上 | 🌧️ |\n| 350-351 | 夜间阵雨 | 🌦️ |\n| 399 | 雨 | 🌧️ |\n\n### 雪\n| 代码 | 含义 | 图标 |\n|------|------|------|\n| 400-403 | 小雪/中雪/大雪/暴雪 | 🌨️ |\n| 404-405 | 雨夹雪/雨雪 | 🌨️ |\n| 406-410 | 各种雪 | 🌨️ |\n| 456-457 | 夜间阵雪 | 🌨️ |\n| 499 | 雪 | 🌨️ |\n\n### 雾/霾/沙尘\n| 代码 | 含义 | 图标 |\n|------|------|------|\n| 500-501 | 薄雾/雾 | 🌫️ |\n| 502 | 霾 | 😷 |\n| 503-504 | 扬沙/浮尘 | 💨 |\n| 507-508 | 沙尘暴 | 💨 |\n| 509-515 | 各种雾/霾 | 🌫️😷 |\n\n### 特殊\n| 代码 | 含义 | 图标 |\n|------|------|------|\n| 900 | 热 | 🥵 |\n| 901 | 冷 | 🥶 |\n| 999 | 未知 | ❓ |\n\n---\n\n## 📊 API 对比\n\n| 特性 | Open-Meteo | 和风天气 |\n|------|------------|----------|\n| 费用 | 免费 | 免费 1000 次/天 |\n| API Key | 不需要 | 需要（TOOLS.md） |\n| 数据源 | 国际 | 中国官方 |\n| 城市识别 | 坐标 | 城市 ID |\n| 体感温度 | ❌ | ✅ |\n| 气压 | ❌ | ✅ |\n| 能见度 | ❌ | ✅ |\n| 中文支持 | ⭐⭐ | ⭐⭐⭐⭐⭐ |\n\n---\n\n## ⚠️ 注意事项\n\n### 安全提示\n- ✅ **敏感信息已加密存储**在 TOOLS.md\n- ✅ **技能文件可安全分享**（无密钥）\n- ❌ **不要** 将 TOOLS.md 提交到 Git\n- ❌ **不要** 在公开场合分享 API Key\n\n### Host 白名单配置\n如果 API 返回 `403 Invalid Host` 错误：\n\n1. 访问 https://console.qweather.com\n2. 找到你的凭据\n3. 配置 Host 白名单：添加 `*` 或 `localhost,127.0.0.1`\n4. 保存后等待 5 分钟生效\n\n### 自动降级机制\n脚本会自动检测和風天气 API 是否可用：\n- ✅ 可用 → 使用和風天气（数据更精准）\n- ❌ 不可用 → 自动切换到 Open-Meteo（免费备用）\n\n### 免费额度\n- 每天 1000 次调用\n- 足够个人项目使用\n- 超限后自动降级到 Open-Meteo\n\n---\n\n## 📚 相关文档\n\n- `docs/qweather-api-reference.md` - API 快速参考\n- `docs/qweather-setup.md` - 配置指南\n- `docs/qweather-setup-issue.md` - 问题排查\n- `scripts/README-WEATHER.md` - 天气脚本使用说明\n\n---\n\n## 🔗 相关链接\n\n- **官方文档**: https://dev.qweather.com/docs/\n- **控制台**: https://console.qweather.com\n- **图标项目**: https://icons.qweather.com\n- **GitHub**: https://github.com/qwd\n\n---\n\n**最后更新**: 2026 年 3 月 4 日  \n**安全状态**: ✅ 敏感信息已加密存储至 TOOLS.md\n","tags":{"latest":"1.0.2"},"stats":{"comments":0,"downloads":1263,"installsAllTime":4,"installsCurrent":4,"stars":1,"versions":3},"createdAt":1772625134516,"updatedAt":1780353875610},"latestVersion":{"version":"1.0.2","createdAt":1772626417618,"changelog":"No code changes. SKILL.md documentation has been expanded with detailed usage instructions, advanced configuration, security guidelines, and weather code tables.  \n- Added comprehensive sections on features, configuration, usage, common city IDs, weather code meanings, and API comparison.\n- Included advanced security setup and safe sharing instructions.\n- Provided troubleshooting steps and auto-fallback mechanism details.\n- Expanded documentation on file structure and external resources.\n- No changes to core code or APIs.","license":null},"metadata":{"setup":[{"key":"QWEATHER_API_KEY","required":true}],"os":null,"systems":null},"owner":{"handle":"zhengge6","userId":"s179vdk5gqwmvztnmbttys4ejn88536q","displayName":"zhengge6","image":"https://avatars.githubusercontent.com/u/78626189?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780089755179}}