Skip to content

Commit c334b42

Browse files
NissonCXclaude
andcommitted
feat: 重命名为 OfferCatcher 并修复安全漏洞
重大更改: - 项目重命名为 OfferCatcher - 仓库迁移: openclaw-offer-radar -> offercatcher - 配置文件重命名: offer-radar.yaml -> offercatcher.yaml - 环境变量重命名: OFFER_RADAR_* -> OFFERCATCHER_* 安全修复: - 修复 AppleScript 命令注入漏洞(完善转义函数) - 修复环境变量注入风险(使用受限环境变量) - 添加 JSON 解析验证和字段长度限制 - 添加路径遍历防护 - 添加 YAML 配置类型验证 功能增强: - 添加 ASCII art 酷炫标题 - 添加中英文双语文档 - 添加 OpenClaw skill 定义 - 添加一键安装脚本 - 添加单元测试 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0b51bee commit c334b42

13 files changed

Lines changed: 1639 additions & 1921 deletions

CLAUDE.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## 项目概述
6+
7+
OfferCatcher 是一个招聘邮件提醒同步工具,配合 OpenClaw 使用。通过 Apple Mail 扫描邮件,OpenClaw LLM 解析内容,Apple Reminders 创建提醒。
8+
9+
## 架构
10+
11+
```
12+
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
13+
│ scan-only │ --> │ OpenClaw │ --> │ apply-events│
14+
│ 获取邮件 │ │ LLM 解析 │ │ 创建提醒 │
15+
└─────────────┘ └─────────────┘ └─────────────┘
16+
```
17+
18+
**不使用正则匹配**:邮件解析由 OpenClaw LLM 完成,能适应各种格式的邮件。
19+
20+
## 常用命令
21+
22+
### 扫描邮件
23+
```bash
24+
python3 scripts/recruiting_sync.py --scan-only
25+
```
26+
返回原始邮件 JSON,供 OpenClaw LLM 解析。
27+
28+
### 应用 LLM 解析结果
29+
```bash
30+
python3 scripts/recruiting_sync.py --apply-events /tmp/events.json --dry-run
31+
python3 scripts/recruiting_sync.py --apply-events /tmp/events.json
32+
```
33+
34+
### 手工记录事件
35+
```bash
36+
python3 scripts/manual_event.py --title "重要事件" --due "2026-04-01 10:00" --notes "入口:https://example.com"
37+
```
38+
39+
### 运行测试
40+
```bash
41+
python3 -m unittest discover tests/ -v
42+
```
43+
44+
## 事件 JSON 格式
45+
46+
`apply-events` 接受的 JSON 格式:
47+
48+
```json
49+
{
50+
"events": [
51+
{
52+
"id": "唯一标识",
53+
"company": "公司名称",
54+
"event_type": "interview | written_exam | assessment | authorization | deadline",
55+
"title": "提醒标题",
56+
"timing": {"start": "YYYY-MM-DD HH:MM", "end": "..."} 或 {"deadline": "..."},
57+
"role": "岗位名称",
58+
"link": "入口链接",
59+
"message_id": "原始邮件ID",
60+
"subject": "邮件主题",
61+
"sender": "发件人"
62+
}
63+
]
64+
}
65+
```
66+
67+
## 核心文件
68+
69+
| 文件 | 作用 |
70+
|------|------|
71+
| `scripts/recruiting_sync.py` | 主脚本:scan-only / apply-events |
72+
| `scripts/apple_reminders_bridge.py` | Apple Reminders 桥接 |
73+
| `scripts/manual_event.py` | 手工记录事件 |
74+
| `scripts/list_mail_sources.py` | 列出 Apple Mail 账户 |
75+
76+
## 配置文件
77+
78+
`~/.openclaw/offercatcher.yaml`
79+
80+
```yaml
81+
mail_account: 谷歌 # Apple Mail 账号名
82+
days: 2 # 扫描天数
83+
max_results: 60 # 最大邮件数
84+
```
85+
86+
## 编码规范
87+
88+
- Python 3.11+,dataclass 定义数据结构
89+
- 中文注释和输出
90+
- 遵循 PEP 8

0 commit comments

Comments
 (0)