← 返回 Skills 市场
woodcoal

⛅ 中国天气查询工具

作者 木炭 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
151
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install china-weather-skill
功能描述
中国城市天气查询工具
使用说明 (SKILL.md)

\r \r

🌤️ 中国城市天气查询工具\r

\r

🛠️ 使用方法\r

\r

python weather.py [-json] [-today] [-life] \x3C地区名称>\r
```\r
\r
### 🎛️ 参数说明:\r
\r
|              |           |                                                                                                                    |\r
| ------------ | --------- | ------------------------------------------------------------------------------------------------------------------ |\r
| **参数**     | **必填**  | **作用描述**                                                                                                       |\r
| `\x3C地区名称>` | **✅ 是** | 你要查询的城市或者区县,比如:`北京`、`深圳`、`铁岭`。(支持地级市及大部分县级市)                                 |\r
| `-json`      | ❌ 否     | **极客模式**:将输出格式转为结构化的 JSON 数据,非常适合喂给 AI 或被其他程序调用。                                 |\r
| `-today`     | ❌ 否     | **只争朝夕模式**:无情裁掉未来 6 天的预报,屏幕上只保留“今天”的数据,界面极其清爽。                                |\r
| `-life`      | ❌ 否     | **婆婆妈妈模式**:默认情况下只显示天气和温度。加上这个开关后,会额外附送感冒、穿衣、洗车、紫外线等各种“生活指数”。 |\r
\r
### 关于查询的地区名称\r
\r
1. 必须是中文;\r
2. 使用标准地区名称,如"成都"、"上海"而非简写,如:"川";\r
3. 只要到地区最后一级即可,如:xx区,xx县,xx市等,查询时无需带区,市,县等字样。\r
\r
**示例**\r
\r
- "北京市" 使用 "北京";\r
- "湘西土家族苗族自治州" 使用 "湘西";\r
- "北京市海淀区" 使用 "海淀"。\r
\r
## 📦 数据输出结构示例 (JSON 模式)\r
\r
如果在调用时使用了 `-json` 参数,你将得到类似如下的完美结构化数据:\r
\r
```\r
{\r
  "city": "北京",\r
  "city_code": "101010100",\r
  "query_time": "2026-03-20 01:30:00",\r
  "source": "weather.com.cn",\r
  "forecast": [\r
    {\r
      "date": "20日(今天)",\r
      "weather": "晴",\r
      "temp_high": "15℃",\r
      "temp_low": "3℃",\r
      "wind": "北风",\r
      "wind_level": "3-4级",\r
      "life_indices": [\r
        {\r
          "name": "穿衣指数",\r
          "key": "clothing",\r
          "level": "较冷",\r
          "description": "建议着厚外套加毛衣等服装。"\r
        }\r
        // ... 其他生活指数\r
      ]\r
    }\r
  ]\r
}\r
```\r
\r
## 🛠️ 备用方案\r
\r
如果中国天气网不可用,可使用以下备用方案解析:\r
\r
```bash\r
# 1. agent-browser 访问\r
agent-browser open "https://www.weather.com.cn/weather/101010100.shtml"\r
\r
# 2. curl 读取 open-meteo.com\r
curl -s "https://api.open-meteo.com/v1/forecast?latitude=39.9042&longitude=116.4074&current_weather=true&daily=temperature_2m_max,temperature_2m_min,weathercode&timezone=Asia%2FShanghai"\r
\r
# 3. wttr.in\r
curl -s "wttr.in/Beijing?T"\r
```\r
\r
---\r
\r
## 📝 使用场景\r
\r
当用户询问以下问题时使用本skill:\r
\r
- "今天天气"\r
- "明天天气"\r
- "[城市名]天气"\r
- "会不会下雨"\r
- "气温多少"\r
- "天气查询"\r
- "最近天气"\r
- "[天数]天天气"\r
\r
---\r
\r
## ⚠️ 注意事项\r
\r
1. **天气数据延迟**:中国天气网数据可能略有延迟\r
2. **网络依赖**:需要能够访问 www.weather.com.cn\r
3. **生活指数**:指数为通用建议,仅供参考\r
安全使用建议
This tool appears to do what it says: fetch weather pages from weather.com.cn, parse them, and cache discovered city codes in a local citys.txt file. It does not request API keys or other secrets. Consider these practical points before installing: (1) network access is required to weather.com.cn (and optional fallbacks like open-meteo/wttr.in); (2) the script will append queried city names/codes to citys.txt in the same folder — if you run it from a sensitive directory it will attempt to write there; (3) city names come from user input and are written to the cache without sanitization (low risk, but you may prefer to run in a dedicated directory or inspect the file periodically); (4) no third‑party packages are installed. If you need extra assurance, review the full weather.py file locally or run the script in a sandboxed environment before granting it broader access.
功能分析
Type: OpenClaw Skill Name: china-weather-skill Version: 1.0.0 The skill bundle is a legitimate weather query tool for Chinese cities using data from weather.com.cn. The Python script (weather.py) uses standard libraries (urllib, html.parser) to fetch and parse weather data, and includes a local caching mechanism that writes city codes to citys.txt. No evidence of data exfiltration, malicious execution, or prompt injection was found.
能力评估
Purpose & Capability
Name/description match the included Python implementation: it fetches data from weather.com.cn, parses forecasts and optional life indices, and uses a local citys.txt as a cache. No unrelated capabilities (cloud credentials, crypto, elevated system access) are requested.
Instruction Scope
SKILL.md instructs running python weather.py and provides curl/agent-browser fallbacks — all aligned with weather lookup. The runtime code performs network requests to weather.com.cn (and the toy1 search endpoint) and will append new city codes to citys.txt in the same directory. Note: the skill reads and may write this local file (append mode).
Install Mechanism
No install spec, no external package downloads or binaries; the skill is instruction+script only and uses only the Python standard library (urllib, HTMLParser).
Credentials
The skill declares no required environment variables, credentials, or config paths. The code does not attempt to read extraneous env vars or secret stores.
Persistence & Privilege
always:false and no automatic system-wide changes. The only persistence is appending discovered city_name,city_code lines to citys.txt in the skill directory (documented behavior). This requires write permission to that directory but does not modify other files or system settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install china-weather-skill
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /china-weather-skill 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release: major update—completely rewritten for Chinese city weather queries. - Now supports querying weather for any Chinese city or county-level region using standard Chinese names. - Adds command line tool (weather.py) with the following options: output as JSON, show only today’s data, and include extended life indices (like clothing, UV, etc.). - Displays structured output with details such as temperature, wind, and various indices; includes sample output. - Fallback methods for weather query are documented, supporting alternate APIs. - Chinese interface and documentation, optimized for users in China.
元数据
Slug china-weather-skill
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

⛅ 中国天气查询工具 是什么?

中国城市天气查询工具. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 151 次。

如何安装 ⛅ 中国天气查询工具?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install china-weather-skill」即可一键安装,无需额外配置。

⛅ 中国天气查询工具 是免费的吗?

是的,⛅ 中国天气查询工具 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

⛅ 中国天气查询工具 支持哪些平台?

⛅ 中国天气查询工具 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 ⛅ 中国天气查询工具?

由 木炭(@woodcoal)开发并维护,当前版本 v1.0.0。

💬 留言讨论