shipping-price-monitor

Monitor shipping carrier prices from Excel files and send alerts when prices drop below thresholds. Invoke when user mentions shipping price monitoring, pric...

MIT-0 · Free to use, modify, and redistribute. No attribution required.
0 · 58 · 1 current installs · 1 all-time installs
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
medium confidence
Purpose & Capability
Name/description align with code: monitor Excel files, analyze prices, manage rules, and send notifications via OpenClaw long-connection or fallback webhooks. Files and config (config/, data/, core/, services/) are consistent with the stated functionality.
Instruction Scope
SKILL.md and runtime code limit actions to reading Excel files in the watch directory, reading/writing local config (config/settings.yaml, config/rules.json), persisting history/logs under the skill, and calling notification endpoints. The skill does not attempt to read unrelated system files or environment variables.
Install Mechanism
No install spec is provided even though the code imports pandas (and will likely need Excel engine libs like openpyxl). Because this is instruction+code without declared dependencies, runtime may fail unless the environment already provides those packages; no external downloads or obscure URLs are used.
Credentials
The skill does not request environment variables or credentials. Notification uses either an OpenClaw 'message' module (imported if present) or user-supplied webhook URLs; webhooks are user-controlled secrets and must be provided by the user if desired.
Persistence & Privilege
Skill is not force-included (always:false). It reads and writes only its own config files under the skill directory and writes monitor.log; it does not modify other skills or system-wide settings.
Assessment
This skill appears to do what it says, but take these precautions before installing/running: - Install required Python packages (pandas and an Excel engine such as openpyxl) in the execution environment, because no install spec is provided and the code will fail without them. - The notifier will attempt to use OpenClaw's message.send if present (this will route alerts through the platform). If that is unavailable, it will call any webhook URLs you supply — treat webhook URLs as secrets and only provide endpoints you trust. - The skill reads Excel files from a configured watch directory and writes local files (config/rules.json, config/settings.yaml, monitor.log). Review and set the watch directory to a safe location so it only sees intended files. - Run first in a controlled/sandbox environment to verify behavior (formatting, notification delivery) before enabling automatic monitoring. - If you need higher assurance, request an explicit dependency/install specification from the author or supply a vetted runtime that includes pandas/openpyxl.

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

Current versionv1.0.0
Download zip
latestvk973bwms70vhzz0b89g4fb4mks83f2wh

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

海运报价监控助手 (Shipping Price Monitor)

实时监控船司报价数据,当价格低于预警阈值时自动发送通知到企业微信/飞书。

目录结构

shipping-price-monitor/
├── config/
│   ├── settings.yaml      # 主配置(监控、通知、日志)
│   └── rules.json         # 用户自定义预警规则
├── data/
│   ├── watch/             # 监控目录(八爪鱼输出Excel)
│   └── history/           # 历史数据存档
├── core/
│   ├── monitor.py         # 文件监控引擎
│   ├── analyzer.py        # 价格分析器
│   └── notifier.py        # 通知发送器
├── services/
│   ├── feishu_bot.py      # 飞书机器人(优先长连接)
│   └── wecom_bot.py       # 企业微信机器人(优先长连接)
├── main.py                # 主入口
└── SKILL.md               # 本文档

激活条件

当用户提到以下内容时激活:

  • "船司报价监控" / "运价监控" / "运费监控"
  • "特价预警" / "价格预警"
  • "开启监控" / "关闭监控"
  • "设置预警规则"
  • "price alert" / "shipping monitor"

功能特性

  • ✅ 实时监控 Excel 文件变化(文件监控模式)
  • ✅ 支持多箱型价格阈值(20GP/40GP/40HQ)
  • ✅ 支持多起运港、目的港、船公司筛选
  • ✅ 支持有效期过滤
  • 优先 OpenClaw 长连接通知(无需配置 Webhook)
  • ✅ 自动回退 Webhook 机制
  • ✅ 防重复通知机制
  • ✅ 多规则管理

通知机制

发送优先级

发送通知
    │
    ▼
┌─────────────────────────────┐
│  1. 优先 OpenClaw 长连接     │
│     无需配置 Webhook         │
│     自动通过 OpenClaw 发送   │
└─────────────┬───────────────┘
              │ 失败
              ▼
┌─────────────────────────────┐
│  2. 回退 Webhook            │
│     需配置 Webhook 地址      │
│     直接调用 API             │
└─────────────┬───────────────┘
              │ 失败
              ▼
┌─────────────────────────────┐
│  3. 返回详细错误信息         │
└─────────────────────────────┘

通知渠道

渠道长连接Webhook推荐度
企业微信✅ 优先使用⚠️ 难获取⭐⭐⭐⭐⭐
飞书✅ 优先使用✅ 简单⭐⭐⭐⭐⭐

企业微信推荐使用长连接方式,无需配置 Webhook 地址即可发送通知。

使用流程

1. 选择通知渠道(可选配置 Webhook)

方式一:使用 OpenClaw 长连接(推荐,无需配置)

设置通知渠道:企业微信

方式二:配置 Webhook(可选,作为备用)

设置企业微信 Webhook: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx
设置飞书 Webhook: https://open.feishu.cn/open-apis/bot/v2/hook/xxx

2. 设置预警规则

添加预警规则:
名称:欧洲航线特价预警
起运港:SHANGHAI, NINGBO, YANTIAN
目的港:LONDON GATEWAY, BREMERHAVEN, WILHELMSHAVEN, GOTHENBURG, ANTWERP, LE HAVRE, ROTTERDAM, HAMBURG, GDANSK
阈值:20GP < 1400,40GP/40HQ < 2400
船公司:MSK, HPL
有效期:03/30-04/05

3. 设置监控目录

设置监控目录:C:\Users\User\.openclaw\media\inbound

4. 开启监控

开启监控

命令列表

命令说明
开启监控启动价格监控
关闭监控停止价格监控
立即检查手动触发一次检查
查看状态查看当前配置和状态
测试通知测试通知连接
添加规则添加新的预警规则
删除规则删除指定规则

Excel 数据格式要求

列名说明示例
POL起运港NINGBO
POD目的港ROTTERDAM
CARRIER船公司MSK
ETD开船日期2026-03-30
20GP20GP价格1350
40GP40GP价格2200
40HQ40HQ价格2250

预警通知示例

🚢 特价预警通知

━━━━━━━━━━━━━━━━━━━━
1. 20GP $1285 (阈值: $1400)
   NINGBO → ROTTERDAM
   船公司: HPL | 开船: 2026-03-27

2. 40GP $2035 (阈值: $2400)
   SHANGHAI → ANTWERP
   船公司: MSK | 开船: 2026-04-02
━━━━━━━━━━━━━━━━━━━━
共发现 2 条特价

配置文件说明

settings.yaml

monitor:
  enabled: false
  check_interval: 60
  watch_directory: ""
  excel_path: ""

notification:
  channel: wecom      # wecom 或 feishu
  feishu_webhook: ""  # 可选,作为备用
  wecom_webhook: ""   # 可选,作为备用

logging:
  level: INFO
  file: monitor.log

data:
  history_dir: "data/history"
  watch_dir: "data/watch"

rules.json

{
  "rules": [
    {
      "id": "rule_001",
      "name": "欧洲航线特价预警",
      "enabled": true,
      "pol": ["SHANGHAI", "NINGBO", "YANTIAN"],
      "pod": ["LONDON GATEWAY", "BREMERHAVEN", ...],
      "carriers": ["MSK", "HPL"],
      "thresholds": {
        "20GP": 1400,
        "40GP": 2400,
        "40HQ": 2400
      },
      "valid_period": {
        "start": "2026-03-30",
        "end": "2026-04-05"
      },
      "description": "欧洲主要港口运价低于阈值时预警"
    }
  ]
}

与八爪鱼 RPA 配合

  1. 八爪鱼 RPA 定时爬取数据,保存到 data/watch/ 目录
  2. 文件监控检测到新文件,自动触发检查
  3. 发现低价自动发送通知(优先长连接)

命令行用法

# 启动监控
python main.py start

# 停止监控
python main.py stop

# 手动检查
python main.py check [excel_path]

# 查看状态
python main.py status

# 测试通知
python main.py test [wecom|feishu]

状态显示示例

==================================================
       海运报价监控助手 - 状态
==================================================

[监控状态]
  已启用: ✅
  运行中: ✅
  监控目录: C:\Users\User\.openclaw\media\inbound
  Excel路径: 
  检查间隔: 60秒
  启用规则数: 1

[通知配置]
  当前渠道: wecom
  默认目标: Liam
  OpenClaw长连接:
    企业微信: ✅ 可用
    飞书: ✅ 可用
  Webhook配置:
    企业微信: ❌ 未配置
    飞书: ❌ 未配置

[预警规则] 共 1 条
  ✅ 欧洲航线特价预警 (ID: rule_001)
      起运港: 3个, 目的港: 9个
      船司: MSK, HPL
      阈值: 20GP=$1400, 40GP=$2400, 40HQ=$2400

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

错误处理

当通知发送失败时,会返回详细的错误信息:

❌ 所有通知方式均失败 - 长连接: OpenClaw 发送失败: xxx | Webhook: 未配置 Webhook

这样可以清楚地知道是哪个环节出了问题。

Files

11 total
Select a file
Select a file to preview.

Comments

Loading comments…