wechat-to-notion
Save a WeChat article to Notion in three steps: fetch → analyze → save.
Configuration Check (Do This First)
Check if the Notion API key is configured:
CODEBLOCK0
If missing, tell the user:
You haven't configured a Notion API key yet:
- 1. Go to https://notion.so/my-integrations → + New integration → copy the key (starts with
ntn_) - Open your Notion database → ... → Connect to → select your integration
- Set the key in your OpenClaw config — do not paste it into chat:
> openclaw config set skills.entries.wechat-to-notion.NOTION_API_KEY "ntn_xxx"
>
OpenClaw will inject it as NOTION_API_KEY automatically.
⚠️ Never ask the user to send the API key as a chat message — it will be exposed in conversation logs.
Setup (One-time)
Ask if the user has an existing Notion database. If yes, use it directly. If no, ask for a parent page URL and create one:
CODEBLOCK2
Match field names to the user's language (e.g. Chinese users get Chinese field names).
Workflow
Step 1: Fetch article
CODEBLOCK3
Step 2: Analyze (inline — reason directly, no subprocess)
Use the read tool to load /tmp/wx_article.json. Read the title and text content from blocks, then produce two outputs by reasoning directly:
Keywords (3–5):
- - Only extract core concepts: the specific technologies, products, or domain terms that define what this article is actually about
- Omit generic/broad terms (e.g. "AI", "efficiency", "productivity", "tools", "development")
- Comma-separated, preserve original casing
Rating (1–5 stars):
Based on readability and value, give a star rating:
- - ⭐ (1): waste of time — clickbait, no substance, or unreadable
- ⭐⭐ (2): below average — padded, shallow, or poorly organized
- ⭐⭐⭐ (3): decent — has useful content but nothing exceptional
- ⭐⭐⭐⭐ (4): good — well-written, actionable, worth bookmarking
- ⭐⭐⭐⭐⭐ (5): excellent — insightful, well-structured, a must-read in its domain
3 stars and above automatically get a "Featured" tag.
Comment (1 sentence, written in the user's language):
Evaluate the article's readability and value, not summarize its content. Focus on:
- - Is it well-structured and easy to follow, or rambling and padded?
- Does it deliver actionable insight, or is it surface-level fluff?
- Who would actually benefit from reading this?
- Example: "Well-structured, flows from theory to hands-on smoothly — ideal for devs wanting to get started with MCP (refreshingly no filler)"
- Example: "Clickbait title, buries the lead under three screens of preamble — the core point could fit in a single tweet"
- Keep it under 35 words. Be direct — praise or criticize with specifics, no hedging.
Step 3: Save to Notion
CODEBLOCK4
- -
read_time: current time in the user's local timezone as ISO 8601 with offset, e.g. INLINECODE7 - INLINECODE8 : comma-separated string
- INLINECODE9 : the single-sentence comment from Step 2
- INLINECODE10 : integer 1–5 (star rating); 3+ automatically adds "Featured" to tags
The script auto-detects field names from the database schema by type (title, url, date, select, multi_select), writes all content blocks in batches of 100, and posts the comment to the Notion Comments panel.
Notes
- - Cover image: extracted from
og:image meta tag, inserted as the first block - Rich text (bold/italic), code blocks, and lists are preserved by INLINECODE17
- Read time defaults to current system time with local UTC offset if omitted
- The comment appears in the Notion Comments panel, not in the page body
- Field names are language-agnostic — the script maps by type, not by name
wechat-to-notion
三步将微信文章保存到Notion:抓取 → 分析 → 保存。
配置检查(请先执行此步骤)
检查是否已配置Notion API密钥:
bash
echo ${NOTIONAPIKEY:0:8}...
如果缺失,告知用户:
您尚未配置Notion API密钥:
- 1. 访问 https://notion.so/my-integrations → + New integration → 复制密钥(以 ntn_ 开头)
- 打开您的Notion数据库 → ... → 连接至 → 选择您的集成
- 在OpenClaw配置中设置密钥 — 请勿粘贴到聊天中:
openclaw config set skills.entries.wechat-to-notion.NOTIONAPIKEY ntn_xxx
OpenClaw会自动将其注入为 NOTIONAPIKEY。
⚠️ 切勿要求用户通过聊天消息发送API密钥——该信息会暴露在对话日志中。
设置(一次性操作)
询问用户是否已有Notion数据库。若有,直接使用;若无,请求提供父页面URL并创建数据库:
bash
curl -s -X POST https://api.notion.com/v1/databases \
-H Authorization: Bearer $NOTIONAPIKEY \
-H Notion-Version: 2025-09-03 \
-H Content-Type: application/json \
-d {
parent: {type: pageid, pageid: pageid>},
title: [{type: text, text: {content: 微信文章}}],
properties: {
标题: {title: {}},
链接: {url: {}},
阅读时间: {date: {}},
评分: {select: {options: [
{name: ⭐, color: gray},
{name: ⭐⭐, color: gray},
{name: ⭐⭐⭐, color: yellow},
{name: ⭐⭐⭐⭐, color: orange},
{name: ⭐⭐⭐⭐⭐, color: red}
]}},
标签: {multi_select: {}},
笔记: {rich_text: {}}
}
}
字段名称需与用户语言匹配(例如中文用户使用中文字段名)。
工作流程
步骤1:抓取文章
bash
python3 {skillDir}/scripts/fetchwechat.py <微信链接> > /tmp/wxarticle.json
步骤2:分析(内联执行——直接推理,无需子进程)
使用 read 工具加载 /tmp/wx_article.json。读取 title 和 blocks 中的文本内容,然后通过直接推理生成两个输出:
关键词(3–5个):
- - 仅提取核心概念:定义文章实际内容的具体技术、产品或领域术语
- 省略通用/宽泛术语(如AI、效率、生产力、工具、开发)
- 逗号分隔,保留原始大小写
评分(1–5星):
基于可读性和价值给出星级评分:
- - ⭐(1):浪费时间——标题党、无实质内容或难以阅读
- ⭐⭐(2):低于平均水平——内容冗长、肤浅或组织混乱
- ⭐⭐⭐(3):尚可——包含有用内容但无突出之处
- ⭐⭐⭐⭐(4):良好——文笔流畅、可操作性强、值得收藏
- ⭐⭐⭐⭐⭐(5):优秀——见解深刻、结构清晰、领域内必读
3星及以上自动添加精选标签。
评论(一句话,使用用户语言撰写):
评价文章的可读性和价值,而非总结内容。关注:
- - 结构是否清晰、易于理解,还是杂乱无章、内容冗长?
- 是否提供可操作的见解,还是流于表面的空洞内容?
- 谁真正能从阅读本文中受益?
- 示例:结构清晰,从理论到实践过渡流畅——适合想要入门MCP的开发者(难得没有废话)
- 示例:标题党,核心内容被三屏铺垫淹没——核心观点一条推文就能说完
- 控制在35字以内。直截了当——具体表扬或批评,不要含糊其辞。
步骤3:保存到Notion
bash
python3 {skillDir}/scripts/savetonotion.py \
/tmp/wx_article.json \
\
<微信链接> \
<阅读时间_ISO8601+08:00> \
<关键词1>,<关键词2>,<关键词3> \
<评论> \
<评分>
- - 阅读时间:用户本地时区的当前时间,ISO 8601格式带偏移量,例如 2026-03-12T14:00:00+08:00
- 关键词:逗号分隔的字符串
- 评论:步骤2中的单句评论
- 评分:整数1–5(星级评分);3分及以上自动在标签中添加精选
脚本通过类型(title、url、date、select、multi_select)自动识别数据库架构中的字段名称,每批100个写入所有内容块,并将评论发布到Notion评论面板。
注意事项
- - 封面图片:从 og:image meta标签提取,作为第一个块插入
- 富文本(加粗/斜体)、代码块和列表由 fetch_wechat.py 保留
- 阅读时间默认为当前系统时间,若省略则使用本地UTC偏移量
- 评论显示在Notion评论面板中,而非页面正文
- 字段名称与语言无关——脚本按类型映射,而非按名称映射