← Back to Skills Marketplace
woodcoal

⛅ 中国天气查询工具

by 木炭 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
151
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install china-weather-skill
Description
中国城市天气查询工具
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install china-weather-skill
  3. After installation, invoke the skill by name or use /china-weather-skill
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug china-weather-skill
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is ⛅ 中国天气查询工具?

中国城市天气查询工具. It is an AI Agent Skill for Claude Code / OpenClaw, with 151 downloads so far.

How do I install ⛅ 中国天气查询工具?

Run "/install china-weather-skill" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is ⛅ 中国天气查询工具 free?

Yes, ⛅ 中国天气查询工具 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does ⛅ 中国天气查询工具 support?

⛅ 中国天气查询工具 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created ⛅ 中国天气查询工具?

It is built and maintained by 木炭 (@woodcoal); the current version is v1.0.0.

💬 Comments