When user sends taxi order screenshots:
Setup (first time only)
CODEBLOCK0
Process Screenshots
CODEBLOCK1
The script will:
- 1. OCR each image with Tesseract.js v4 (uses coordinates to detect text positions)
- Parse orders: date, time, start/end point, amount
- Smart amount extraction: handles OCR misreads (¥→%, missing ¥, missing decimal)
- Filter: only weekday evening rides (after 21:00) qualify for reimbursement
- Auto-exclude closed/cancelled orders (amount = ¥0)
- White block desensitization on destination address in screenshots (keeps first/last char visible)
- Desensitize destination text in Excel (e.g. 古*门)
- Save screenshots to INLINECODE0
- Update
~/.openclaw/workspace/taxi_expense/taxi_data.json (auto-dedup by date+amount) - Generate monthly Excel: INLINECODE2
Excel Columns
序号 | 日期 | 星期 | 时间 | 起点 | 终点(脱敏) | 金额 | 备注
Sheet 2 contains mosaiced order screenshots.
Output
Tell user:
- - How many new orders were added
- Monthly totals (reimbursable orders only)
- Any skipped orders and why (weekend, before 21:00, closed, ¥0)
Send Preview (only if user asks)
The script saves desensitized screenshots to the
screenshots/ directory. Send via:
CODEBLOCK2
Known Issues
- - Tesseract Chinese quality is imperfect ("点"→"炭", "轻享"→"轻亭")
- Uses regex
/终[点炭]/ for tolerant matching - Amount recognition: ¥ may be misread as % or lost entirely
- Amount > 500 is auto-corrected (missing decimal: 1970→19.70)
- Source images must be ORIGINAL screenshots (not previously processed/cropped)
- Multiple images supported: INLINECODE5
技能名称: taxi_expense
详细描述:
当用户发送出租车订单截图时:
设置(仅首次使用)
bash
bash ~/.openclaw/workspace/skills/taxi_expense/scripts/setup.sh
处理截图
bash
node ~/.openclaw/workspace/skills/taxi_expense/scripts/process.js <图片1> [图片2] ...
脚本将:
- 1. 使用 Tesseract.js v4 对每张图片进行 OCR(利用坐标检测文本位置)
- 解析订单:日期、时间、起点/终点、金额
- 智能金额提取:处理 OCR 识别错误(¥→%、缺少¥、缺少小数点)
- 筛选:仅工作日晚间行程(21:00后)符合报销条件
- 自动排除已关闭/已取消的订单(金额 = ¥0)
- 对截图中目的地地址进行白色方块脱敏处理(保留首尾字符可见)
- 对 Excel 中的目的地文本进行脱敏(例如 古*门)
- 将截图保存至 ~/.openclaw/workspace/taxiexpense/screenshots/
- 更新 ~/.openclaw/workspace/taxiexpense/taxidata.json(按日期+金额自动去重)
- 生成月度 Excel 文件:~/.openclaw/workspace/taxiexpense/YYYY-MM-taxi_expense.xlsx
Excel 列
序号 | 日期 | 星期 | 时间 | 起点 | 终点(脱敏) | 金额 | 备注
工作表2包含马赛克处理后的订单截图。
输出
告知用户:
- - 新增了多少条订单
- 月度总计(仅限可报销订单)
- 任何被跳过的订单及其原因(周末、21:00前、已关闭、¥0)
发送预览(仅当用户要求时)
脚本将脱敏后的截图保存至 screenshots/ 目录。通过以下方式发送:
bash
openclaw message send --channel telegram --target <聊天ID> --message 消息 --media <文件.xlsx>
已知问题
- - Tesseract 中文识别质量不完美(点→炭,轻享→轻亭)
- 使用正则表达式 /终[点炭]/ 进行容错匹配
- 金额识别:¥ 可能被误识别为 % 或完全丢失
- 金额 > 500 时自动修正(缺少小数点:1970→19.70)
- 源图片必须是原始截图(未经处理或裁剪)
- 支持多张图片:node process.js img1 img2 img3