将网页文章及用户笔记抓取并整理为清洁格式,保存到本地 Obsidian vault 的指定目录中。
将网页文章保存到本地 Obsidian vault。
当用户发送:
例如:
保存到 Obsidian 的格式如下:
---
title: "文章标题"
url: "原始链接"
created: "YYYY/MM/DD"
pagecomment: "用户添加的页面评论"
---
> [!note]- 📄 Full Article
> 文章第一段内容...
> 文章第二段内容...
> 用户笔记内容
^note-xxx
https://r.jina.ai/<URL>web_fetch 工具<title> 或 <h1>)<>:"|?* 替换为 --[...内容已截断...]\u200B\u200C\u200D\uFEFF~/Documents/Obsidian Vault/Collections/function generateBlockReferenceId(noteText, url) {
const hash = simpleHash(`${url}|${noteText}`.toLowerCase());
return `note-${hash}`;
}
function simpleHash(str) {
let hash = 0;
for (let i = 0; i < str.length; i++) {
hash = (hash << 5) - hash + str.charCodeAt(i);
hash |= 0;
}
return Math.abs(hash).toString(36);
}
function cleanSpecialCharacters(text) {
return text
.replace(/[\u200B\u200C\u200D\uFEFF]/g, '')
.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, '')
.replace(/[\u00A0\u1680\u180E\u2000-\u200A\u202F\u205F\u3000]/g, ' ')
.replace(/[\u200E\u200F\u202A-\u202E\u2066-\u2069]/g, '')
.replace(/[\uE000-\uF8FF]/g, '')
.replace(/ +/g, ' ');
}
> [!note]- 📄 Full Article (max 50000 chars)
> 第一行
> 第二行
> ...
https://r.jina.ai/<原始URL>
https://r.jina.ai/https://x.com/...https://r.jina.ai/https://mp.weixin.qq.com/...用户输入:
https://example.com/article 我的笔记:这篇文章讲了三件事
输出保存到 Obsidian:
---
title: "Example Article"
url: "https://example.com/article"
created: "2026/03/04"
pagecomment: ""
---
> [!note]- 📄 Full Article (max 50000 chars)
> Article content here...
> 我的笔记:这篇文章讲了三件事
^note-abc123
ZIP package — ready to use