← 返回 Skills 市场
vlalamoon

彩云天气每日推送

作者 vlalamoon · GitHub ↗ · v2.0.0 · MIT-0
cross-platform ✓ 安全检测通过
136
总下载
0
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install caiyun-weather-daily
功能描述
彩云天气每日推送。每天定时查询天气并通过微信/消息渠道推送天气早报。支持自定义位置、推送时间和推送渠道。Use when user wants to set up daily weather notifications.
使用说明 (SKILL.md)

彩云天气每日推送

定时查询彩云天气 API,生成天气早报并推送到指定渠道。

功能

  • 🌤️ 实时天气数据(气温、体感、湿度、风速)
  • 📅 今日气温范围(最高/最低)
  • 🌧️ 降雨预测(今日是否降雨、2小时内降雨概率)
  • ⏰ 定时推送(可配置推送时间)
  • 📱 多渠道推送(微信、Telegram、Discord 等)

配置

必需配置

参数 说明 获取方式
CAIYUN_TOKEN 彩云天气 API Token 彩云开发者平台
LNG 经度 地图工具获取
LAT 纬度 地图工具获取

可选配置

参数 说明 默认值
PUSH_TIME 推送时间(cron 表达式) 0 7 * * *(每天 7:00)
PUSH_CHANNEL 推送渠道 wechat
LOCATION_NAME 位置名称(显示用) 当前位置

使用方式

方式 1:通过 OpenClaw Cron 配置

在 OpenClaw 的 cron 配置中添加:

{
  "name": "每日天气推送",
  "schedule": { "kind": "cron", "expr": "0 7 * * *", "tz": "Asia/Shanghai" },
  "sessionTarget": "isolated",
  "payload": {
    "kind": "agentTurn",
    "message": "调用彩云天气脚本推送今日天气"
  },
  "delivery": { "mode": "announce", "channel": "wechat" }
}

方式 2:直接运行脚本

# 设置环境变量
export CAIYUN_TOKEN="your_token"
export LNG="116.4"   # 你的经度
export LAT="39.9"    # 你的纬度

# 运行
python3 weather_push.py

方式 3:手动查询

# 快速查询当前天气
curl -s "https://api.caiyunapp.com/v2.6/${CAIYUN_TOKEN}/${LNG},${LAT}/realtime?lang=zh_CN" | python3 -c "
import sys, json
d = json.load(sys.stdin)
r = d['result']['realtime']
print(f\"气温: {r['temperature']}°C, 体感: {r['apparent_temperature']}°C, 湿度: {int(r['humidity']*100)}%\")
"

输出格式

🌤 当前位置 今日天气

🌡 气温:18°C ~ 25°C
🤔 体感:23°C
💧 湿度:65%
🌧 今日降雨:否
⏱ 2小时内降雨:否

彩云天气 API

获取 Token

  1. 访问 彩云天气开发者平台
  2. 注册账号并创建应用
  3. 获取 API Token

API 端点

端点 说明
/realtime 实时天气
/daily 日级预报(最多 5 天)
/minutely 分钟级降水(2 小时)
/hourly 小时级预报(48 小时)
/weather 综合接口(包含以上全部)

示例请求

# 综合天气数据
curl -s "https://api.caiyunapp.com/v2.6/YOUR_TOKEN/LNG,LAT/weather?lang=zh_CN&unit=metric&alert=true"

依赖

  • Python 3.7+
  • curl
  • OpenClaw(用于定时任务和消息推送)

扩展

添加天气预警

修改脚本,解析 alert=true 返回的预警数据:

alerts = data.get('result', {}).get('alert', {}).get('content', [])
for alert in alerts:
    print(f"⚠️ {alert['title']}: {alert['description']}")

多地点推送

在脚本中添加多个位置:

LOCATIONS = [
    {"name": "北京", "lng": "116.4", "lat": "39.9"},
    {"name": "上海", "lng": "121.4", "lat": "31.2"},
]

条件推送

只在特定天气条件下推送:

# 只在今日有雨时推送
if has_rain_today:
    send_weather_push()
安全使用建议
This package appears to do what it says: call 彩云天气 API and format/push a daily weather message. Before installing: (1) Confirm the CAIYUN_TOKEN is a dedicated API token kept in a secure environment variable (do not paste into chat). (2) Because the source/homepage is unknown, prefer running the scripts locally in a controlled account or container and use the --dry-run to inspect output first. (3) If you don't want an external CLI used, remove or ignore the OpenClaw send step; the code prints the message as fallback. (4) Verify registry metadata vs SKILL.md (the registry omitted required env vars) — ask the publisher for a canonical source or repo if you need stronger provenance.
功能分析
Type: OpenClaw Skill Name: caiyun-weather-daily Version: 2.0.0 The skill bundle is a legitimate utility for fetching weather data from the Caiyun API and sending daily notifications via OpenClaw. Both the shell script (daily_weather.sh) and Python script (weather_push.py) implement standard API requests and message formatting logic, using environment variables for configuration and the OpenClaw CLI for delivery, with no evidence of malicious intent, data exfiltration, or prompt injection.
能力评估
Purpose & Capability
Name/description, SKILL.md, and included scripts consistently implement a Caiyun-weather->message-push workflow. Minor metadata mismatch: the registry metadata lists no required env vars while SKILL.md and the scripts require CAIYUN_TOKEN, LNG, LAT (and optionally LOCATION_NAME/PUSH_CHANNEL). This is a transparency/metadata issue but not a functional mismatch.
Instruction Scope
Runtime instructions and scripts only fetch data from api.caiyunapp.com, parse it locally, and attempt to send via an OpenClaw CLI if available. They do not read unrelated system files, scan for other credentials, or exfiltrate to third-party endpoints.
Install Mechanism
No install spec (instruction-only with shipped scripts). Nothing is downloaded from arbitrary URLs or installed automatically; risk from install mechanism is low.
Credentials
Environment variables used (CAIYUN_TOKEN, LNG, LAT, optional LOCATION_NAME, PUSH_CHANNEL) are proportional to the task. Note the registry metadata omission of required env vars — confirm you provide only the Caiyun token and coordinates. No other secrets or unrelated service credentials are requested.
Persistence & Privilege
always:false and user-invocable; the skill does not request persistent system privileges or modify other skills/configs. It only invokes OpenClaw CLI when present and otherwise prints the message.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install caiyun-weather-daily
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /caiyun-weather-daily 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.0.0
定时天气推送;支持多渠道通知;安全修复:所有配置通过环境变量
v1.0.2
安全修复:移除所有位置信息,改用环境变量配置
v1.0.1
安全修复:移除硬编码 Token,改用环境变量
v1.0.0
首次发布:支持定时天气推送、多渠道通知、自定义位置
元数据
Slug caiyun-weather-daily
版本 2.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 4
常见问题

彩云天气每日推送 是什么?

彩云天气每日推送。每天定时查询天气并通过微信/消息渠道推送天气早报。支持自定义位置、推送时间和推送渠道。Use when user wants to set up daily weather notifications. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 136 次。

如何安装 彩云天气每日推送?

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

彩云天气每日推送 是免费的吗?

是的,彩云天气每日推送 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

彩云天气每日推送 支持哪些平台?

彩云天气每日推送 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 彩云天气每日推送?

由 vlalamoon(@vlalamoon)开发并维护,当前版本 v2.0.0。

💬 留言讨论