get-city-weather

v1.0.0

获取指定城市的天气信息,包括温度、天气状况、风力、空气质量等。当用户询问天气、需要天气数据或提到城市天气时使用此技能。

0· 90·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for yiweiweilai/get-city-weather.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "get-city-weather" (yiweiweilai/get-city-weather) from ClawHub.
Skill page: https://clawhub.ai/yiweiweilai/get-city-weather
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install get-city-weather

ClawHub CLI

Package manager switcher

npx clawhub@latest install get-city-weather
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (get-city-weather) align with the code and instructions: the script calls apis.juhe.cn/simpleWeather/query to obtain weather, formats a report and writes it to an output directory. No unrelated services or capabilities are requested.
Instruction Scope
SKILL.md instructs running the included Python script with a city argument, and describes reading an API key from environment or .env, producing a report file. The script only reads the skill's .env, standard environment variables, and writes to the skill's own output directory; it makes network requests only to the declared Juhe API endpoint.
Install Mechanism
There is no installer; this is instruction-plus-script. The only runtime dependency is Python (3.6+) and the requests package (pip-installable). No remote downloads or archive extraction are performed by the skill.
Credentials
The script requires an API key via JUHE_WEATHER_API_KEY or WEATHER_API_KEY (or .env). That credential is proportional to the stated purpose. However, the registry metadata lists no required environment variables — an inconsistency that could confuse deployers or lead to failures if the key is not supplied.
Persistence & Privilege
Skill is not always-enabled and does not request elevated persistence. It writes only to its own output/ directory and does not modify other skills or system-wide configuration.
Assessment
This skill appears to do exactly what it says: call the Juhe weather API and write a local text report. Before installing, provide a valid JUHE_WEATHER_API_KEY (or WEATHER_API_KEY) via environment variables or the included .env file — the registry metadata omitted declaring this requirement. Ensure you trust the Juhe API endpoint, have network access to apis.juhe.cn, and are comfortable the skill will create files under the skill's output/ directory. Also install the Python requests package (pip install requests) in the environment that will run the script.

Like a lobster shell, security has layers — review code before you run it.

latestvk976gq8epj4xvk6h3cy16afjw584cvh5
90downloads
0stars
1versions
Updated 3w ago
v1.0.0
MIT-0

获取天气信息

功能概述

此技能用于获取中国各城市的实时天气信息,包括:

  • 当前温度和天气状况
  • 风向和风力
  • 空气质量指数(AQI)
  • 生活指数建议

使用方法

1. 获取天气信息

在技能目录下运行天气获取脚本:

python scripts/get_weather.py [城市名]

Windows PowerShell 如遇控制台编码问题,可直接运行:

$env:PYTHONIOENCODING="utf-8"
python .\scripts\get_weather.py 深圳

如果从其他目录调用,可先切换到技能目录,或使用相对路径:

python .\get-weather\scripts\get_weather.py 深圳

示例:

python scripts/get_weather.py 北京
python scripts/get_weather.py 上海

2. 查看天气报告

脚本执行后会生成天气报告文件:

  • 位置:./get-weather/output/weather_report_[城市]_[日期].txt
  • 包含完整的天气信息和生活建议

实现方式

本技能通过聚合数据 simpleWeather/query 接口获取实时天气,并从环境变量或 .env 读取 API Key。脚本启动时会主动将 stdout/stderr 配置为 UTF-8,减少 Windows 控制台输出中文和 emoji 时的编码错误。

配置说明

API 密钥配置(必填)

脚本会按以下顺序读取 API Key:

  1. 环境变量 JUHE_WEATHER_API_KEY
  2. 环境变量 WEATHER_API_KEY
  3. 技能目录下的 .env 文件

.env 示例:

JUHE_WEATHER_API_KEY=your_api_key_here

PowerShell 示例:

$env:JUHE_WEATHER_API_KEY="your_api_key_here"
python .\scripts\get_weather.py 深圳

接口信息:

  • 地址:http://apis.juhe.cn/simpleWeather/query
  • 方法:GET
  • 参数:citykey

未配置 API Key 或接口请求失败时,脚本会直接报错退出。

输出示例

========================================
          北京市 今日天气报告
========================================

📅 日期:2026年03月17日 星期二

🌡️  温度:15°C ~ 22°C
    当前:18°C

☁️  天气:多云

💨 风力:东南风 3级

🌫️ 空气质量:良 (AQI: 65)

💡 生活指数:
    • 穿衣:建议穿薄外套
    • 运动:适宜户外运动
    • 洗车:适宜洗车
    • 感冒:较易发,注意防护

========================================

依赖要求

  • Python 3.6+
  • requests

安装依赖:

pip install requests

Comments

Loading comments...