关于 restaurant-booking
restaurant-booking 是一项通过 Notte 浏览器自动化预订餐厅的技能,适用于需要安排用餐的用户。它提供 OpenTable 预订步骤,也说明了 Resy 的替代流程及预订后的日历记录。
主要功能
- 01启动 Notte 浏览器会话
- 02选择餐厅、日期、时间与人数
- 03填写联系信息并提交预订
- 04抓取页面核对确认结果
- 05预订后创建日历事件
适用场景
- 01通过 OpenTable 预订餐位
- 02通过 Resy 预约餐厅
- 03核实预订是否确认
- 04将预订添加到日历
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ gooseworks-ai/ goose-skills --skill restaurant-booking安装后在 Claude Code 中输入/restaurant-booking确认已加载。
附带文件skill.meta.json
详细介绍
餐厅预订
设置
从 ~/.gooseworks/credentials.json 读取你的凭据:
export GOOSEWORKS_API_KEY=$(python3 -c "import json;print(json.load(open('$HOME/.gooseworks/credentials.json'))['api_key'])")
export GOOSEWORKS_API_BASE=$(python3 -c "import json;print(json.load(open('$HOME/.gooseworks/credentials.json')).get('api_base','https://api.gooseworks.ai'))")
如果 ~/.gooseworks/credentials.json 不存在,请告知用户运行:npx gooseworks login
所有端点均使用 Bearer 身份验证:-H "Authorization: Bearer $GOOSEWORKS_API_KEY"
通过 Orthogonal 使用 Notte 浏览器自动化预订。
要求
- Orthogonal CLI(
npm install -g @orth/cli)或 API 密钥 - 客人信息:姓名、电子邮件、电话
快速流程
- 启动 Notte 会话
- 前往预订网站(优先使用 OpenTable)
- 选择日期、时间和人数
- 填写联系表单
- 提交并确认
CLI 方法(推荐)
1. 启动 Notte 会话
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"notte","path":"/sessions/start"}'
--body '{"browser_type":"chromium","headless":true,"solve_captchas":true,"idle_timeout_minutes":10}'
保存响应中的 session_id。
2. 前往 OpenTable
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"notte","path":"/sessions/{session_id}/page/execute"}'
--body '{"type":"goto","url":"https://www.opentable.com/r/{restaurant}?datetime=2026-02-17T19:00&covers=2"}'
3. 点击时段
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"notte","path":"/sessions/{session_id}/page/execute"}'
--body '{"type":"click","selector":"button:has-text(\"7:00 PM\")"}'
4. 选择座位(如有提示)
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"notte","path":"/sessions/{session_id}/page/execute"}'
--body '{"type":"click","selector":"button:has-text(\"Select\")"}'
5. 填写表单
# First name
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"notte","path":"/sessions/{session_id}/page/execute"}'
--body '{"type":"fill","selector":"input#firstName","value":"John"}'
# Last name
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"notte","path":"/sessions/{session_id}/page/execute"}'
--body '{"type":"fill","selector":"input#lastName","value":"Doe"}'
# Email
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"notte","path":"/sessions/{session_id}/page/execute"}'
--body '{"type":"fill","selector":"input#email","value":"[email protected]"}'
# Phone
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"notte","path":"/sessions/{session_id}/page/execute"}'
--body '{"type":"fill","selector":"input#phoneNumber","value":"4155551234"}'
6. 接受条款
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"notte","path":"/sessions/{session_id}/page/execute"}'
--body '{"type":"click","selector":"text=I agree to the restaurant"}'
7. 提交预订
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"notte","path":"/sessions/{session_id}/page/execute"}'
--body '{"type":"click","selector":"button:has-text(\"Complete reservation\")"}'
8. 验证确认信息
curl -s -X POST $GOOSEWORKS_API_BASE/v1/proxy/orthogonal/run \
-H "Authorization: Bearer $GOOSEWORKS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"api":"notte","path":"/sessions/{session_id}/page/scrape"}'
--body '{"only_main_content":true}'
在响应中查找“confirmed”。
API 方法(curl)
# Start session
curl -X POST "https://api.orth.sh/v1/run" \
-H "Content-Type: application/json" \
-d '{
"api": "notte",
"path": "/sessions/start",
"body": {
"browser_type": "chromium",
"headless": true,
"solve_captchas": true,
"idle_timeout_minutes": 10
}
}'
# Execute actions (same pattern)
curl -X POST "https://api.orth.sh/v1/run" \
-H "Content-Type: application/json" \
-d '{
"api": "notte",
"path": "/sessions/{session_id}/page/execute",
"body": {"type":"goto","url":"https://www.opentable.com/..."}
}'
关键选择器(OpenTable)
| 字段 | 选择器 |
|---|---|
| 名 | input#firstName |
| 姓 | input#lastName |
| 电子邮件 | input#email |
| 电话 | input#phoneNumber |
| 条款复选框 | text=I agree to the restaurant |
| 提交 | button:has-text('Complete reservation') |
| 时段 | button:has-text('7:00 PM') |
| 座位选择 | button:has-text('Select') |
查找餐厅 ID
搜索 OpenTable 并从 URL 中提取:
restref=1906→ Foreign Cinema- URL 路径中的餐厅 slug
URL 格式示例:
https://www.opentable.com/r/{restaurant-slug}?restref={id}&datetime={YYYY-MM-DDTHH:MM}&covers={n}
提示
- OpenTable 会为你保留餐桌 5 分钟,请尽快操作
- 使用带有
value参数的fill操作(不要使用带有text的type) - 通过标签文本点击条款,而不是直接点击复选框
- 无需信用卡,预订免费
- 确认电子邮件会自动发送
Resy 替代方案
如果餐厅使用 Resy:
https://resy.com/cities/{city}/venues/{restaurant}?date={YYYY-MM-DD}&seats={n}
流程类似,但选择器不同。请先抓取页面以识别表单字段。
预订后
- 使用
gog calendar create创建日历事件 - 添加参与者和地点
- 在描述中填写确认编号
评论
支持 Markdown