Feishu Book Match
Fill 匹配结果 (match color) and 书籍链接 (Amazon detail link) for books in a Feishu Bitable by querying Amazon UK/US with ISBN.
Step-by-Step Workflow
1. Parse the Bitable URL
Use feishu_bitable_get_meta on the Feishu wiki/base URL to get app_token and table_id.
2. Confirm Field IDs
Use feishu_bitable_list_fields to find the field IDs. Expected field names:
- -
ISBN → fieldid (e.g. fldbjxXubv) - INLINECODE6 → fieldid (e.g.
fld8AkZOXn) - INLINECODE8 → fieldid (e.g.
fldEVOXS5u) - INLINECODE10 → fieldid (e.g.
fldrgtxF6l) - INLINECODE12 → field_id (e.g.
fldxZrhJeG)
3. Find Unprocessed Records
Use feishu_bitable_list_records with page_size=100. Filter to records where 匹配结果 is empty. Process in batches.
4. Query Amazon (Browser Relay)
Use Chrome browser relay (profile: "chrome-relay"):
Step A: Amazon UK search
URL: INLINECODE18
Step B: Check results
- - If page shows "No results for your search query in Books" → try Amazon US:
https://www.amazon.com/s?k={ISBN}
- - If Amazon US also shows no results → mark 匹配结果 =
🔴 未匹配 → update Bitable → stop for this ISBN
Step C: Get first result info
Take the first search result (usually div[data-cy="title-recipe"]). Extract:
- - Title: from the heading inside
div[data-cy="title-recipe"] or INLINECODE23 - Author: from the author line (often contains
by text or a link)
5. Determine Match Color
Compare Amazon result with Excel Title and Author:
- - 🟢 完全一致 (green): Title AND Author both match exactly
- 🟡 可能一致 (yellow): Title matches, Author similar or slightly different
- 🔴 很可能不同 (red): Title or Author clearly different
Common causes of yellow:
- - Amazon shows audiobook narrator alongside author (e.g., "Ian Rankin and James Macpherson" where Macpherson is the narrator)
- Slight title variations (subtitle differences, punctuation)
- Author name formatting differences
6. Get Detail Link
Execute in the browser tab:
CODEBLOCK0
Strip query parameters — keep only the clean path:
CODEBLOCK1
7. Update Bitable Record
Use feishu_bitable_update_record:
CODEBLOCK2
Known Field IDs (RIVERSIDE_BOOKS Table)
| Field | field_id |
|---|
| ISBN | fldbjxXubv |
| Title |
fld8AkZOXn |
| Author | fldEVOXS5u |
| 匹配结果 | fldrgtxF6l |
| 书籍链接 | fldxZrhJeG |
These are stable for the specific table tblskx3DEQkwhc9r. Always verify with feishu_bitable_list_fields if unsure.
Batch Processing
For large tables (2000+ records):
- 1. Process in batches of 20–50
- Use
feishu_bitable_list_records with page_token for pagination - Filter out already-processed records (匹配结果 not empty)
- Report progress after each batch
- Use background exec or cron if the task needs to run unattended
Tips
- - ISBN normalization: Some ISBNs have dashes; Amazon search works better with dashes removed (e.g.,
978-0857834768 → 9780857834768) - CD/audiobook: Category 1 = "CD" often indicates audiobook — author on Amazon may differ (narrator vs author)
- No results on .co.uk: Always fall back to
.com before marking as unmatched - Chrome relay tab reuse: If a tab is already on the right URL, navigate to the new ISBN URL directly rather than opening a new tab
飞书图书匹配
通过查询亚马逊英国/美国站点的ISBN,为飞书多维表格中的书籍填充匹配结果(匹配颜色)和书籍链接(亚马逊详情链接)。
分步工作流程
1. 解析多维表格链接
使用feishubitablegetmeta解析飞书知识库/表格链接,获取apptoken和table_id。
2. 确认字段ID
使用feishubitablelist_fields查找字段ID。预期字段名称:
- - ISBN → 字段ID(例如fldbjxXubv)
- Title → 字段ID(例如fld8AkZOXn)
- Author → 字段ID(例如fldEVOXS5u)
- 匹配结果 → 字段ID(例如fldrgtxF6l)
- 书籍链接 → 字段ID(例如fldxZrhJeG)
3. 查找未处理记录
使用feishubitablelistrecords并设置pagesize=100。筛选出匹配结果为空的记录。分批处理。
4. 查询亚马逊(浏览器中继)
使用Chrome浏览器中继(profile: chrome-relay):
步骤A:亚马逊英国站搜索
网址:https://www.amazon.co.uk/s?k={ISBN}
步骤B:检查结果
- - 如果页面显示在图书中未找到您的搜索查询结果→ 尝试亚马逊美国站:
https://www.amazon.com/s?k={ISBN}
- - 如果亚马逊美国站也未显示结果→ 标记匹配结果 = 🔴 未匹配 → 更新多维表格 → 停止处理该ISBN
步骤C:获取第一个结果信息
取第一个搜索结果(通常为div[data-cy=title-recipe])。提取:
- - 标题:来自div[data-cy=title-recipe]内的标题或h2 a span
- 作者:来自作者行(通常包含by 文本或链接)
5. 确定匹配颜色
将亚马逊结果与Excel中的Title和Author进行比较:
- - 🟢 完全一致(绿色):标题和作者均完全匹配
- 🟡 可能一致(黄色):标题匹配,作者相似或略有不同
- 🔴 很可能不同(红色):标题或作者明显不同
黄色标记的常见原因:
- - 亚马逊显示有声读物旁白者与作者并列(例如Ian Rankin and James Macpherson,其中Macpherson是旁白者)
- 标题略有变化(副标题差异、标点符号不同)
- 作者姓名格式差异
6. 获取详情链接
在浏览器标签页中执行:
javascript
() => {
const el = document.querySelector(div[data-cy=title-recipe] a);
return el ? el.href : null;
}
去除查询参数 — 仅保留干净的路径:
来源:https://www.amazon.co.uk/Art-Edible-Flowers-.../dp/B07BQD9D5N?ref=...&dib=...
目标:https://www.amazon.co.uk/Art-Edible-Flowers-.../dp/B07BQD9D5N
7. 更新多维表格记录
使用feishubitableupdate_record:
json
{
匹配结果: 完全一致,
书籍链接: https://www.amazon.co.uk/.../dp/ASIN
}
已知字段ID(RIVERSIDE_BOOKS表格)
| 字段 | 字段ID |
|---|
| ISBN | fldbjxXubv |
| Title |
fld8AkZOXn |
| Author | fldEVOXS5u |
| 匹配结果 | fldrgtxF6l |
| 书籍链接 | fldxZrhJeG |
这些ID针对特定表格tblskx3DEQkwhc9r是稳定的。如有疑问,请始终使用feishubitablelist_fields进行验证。
批量处理
对于大型表格(2000+条记录):
- 1. 每批处理20-50条
- 使用带pagetoken的feishubitablelistrecords进行分页
- 过滤掉已处理的记录(匹配结果不为空)
- 每批处理后报告进度
- 如果任务需要无人值守运行,使用后台执行或定时任务
提示
- - ISBN标准化:部分ISBN包含连字符;去除连字符后亚马逊搜索效果更好(例如978-0857834768 → 9780857834768)
- CD/有声读物:类别1 = CD通常表示有声读物——亚马逊上的作者可能不同(旁白者与作者)
- .co.uk无结果:在标记为未匹配之前,始终回退到.com进行搜索
- Chrome中继标签页复用:如果标签页已在正确的网址上,直接导航到新的ISBN网址,而不是打开新标签页