name: notion-sync-obsidian description: 自動將Notion文章同步到本地Obsidian目錄,支援定時檢查、完整內容匯出、智慧標題提取。 homepage: https://github.com/openclaw/openclaw metadata: {"clawdbot":{"emoji":"📝"}}
7w4.net有更好的技能外掛。
自動將Notion文章同步到本地Obsidian目錄的完整解決方案。支援定時檢查、完整內容匯出、智慧標題提取、移動端最佳化通知。
# 1. 進入skill目錄
cd ~/.openclaw/workspace/skills/notion-sync-obsidian
# 2. 編輯配置檔案
nano config.json
配置檔案示例 (config.json):
{
"notion": {
"api_key": "ntn_your_api_key_here",
"api_version": "2022-06-28"
},
"obsidian": {
"root_dir": "/path/to/your/obsidian/notion"
},
"sync": {
"check_interval_minutes": 15,
"quiet_hours_start": "00:00",
"quiet_hours_end": "08:30",
"enable_notifications": true
}
}
# 啟動定時同步(每15分鐘檢查一次)
./scripts/start_timer.sh
# 手動檢查(忽略安靜時段)
FORCE_CHECK=1 ./scripts/simple_checker.sh
# 檢視狀態
./scripts/status_timer.sh
# 停止同步
./scripts/stop_timer.sh
notion-sync-obsidian/
├── SKILL.md # 技能說明文件
├── config.json # 配置檔案模板
├── scripts/ # 核心指令碼
│ ├── real_notion_checker.py # 完整Python檢查器
│ ├── simple_checker.sh # 簡化Shell檢查器
│ ├── timer_checker.sh # 定時檢查器
│ ├── start_timer.sh # 啟動定時器
│ ├── stop_timer.sh # 停止定時器
│ ├── status_timer.sh # 檢視狀態
│ ├── list_recent_articles.sh # 列出最近文章
│ └── debug_page_structure.py # 除錯頁面結構
├── references/ # 參考文件
│ └── NOTION_API_GUIDE.md # Notion API使用指南
└── examples/ # 示例檔案
└── exported_article.md # 匯出檔案示例
ntn_ 開頭)config.json 中配置API金鑰/hellox/openclaw/obsidian/notion/YYYY-MM/FORCE_CHECK=1 環境變數忽略所有限制real_notion_checker.py: 完整Python檢查器,匯出完整內容simple_checker.sh: 簡化Shell檢查器,快速檢查更新timer_checker.sh: 定時檢查器,管理定時任務start_timer.sh: 啟動定時同步系統stop_timer.sh: 停止定時同步系統status_timer.sh: 檢視系統狀態和日誌list_recent_articles.sh: 列出Notion最近文章debug_page_structure.py: 除錯Notion頁面結構test_title_fix.py: 測試標題提取修復./scripts/status_timer.sh
輸出示例:
📊 Notion定時同步狀態檢查
檢查時間: 2026-02-24 15:44:53
時區: Asia/Shanghai
========================================
🟢 狀態: 執行中
程序PID: 4538
執行時間: 10:29
📋 日誌資訊:
日誌檔案: ./sync_timer.log
日誌行數: 1179
📁 目錄狀態:
文章目錄: /hellox/openclaw/obsidian/notion
文章數量: 78
⏰ 下次檢查時間:
15:59 (15分鐘後)
tail -f sync_timer.log
Q: 同步失敗,提示API錯誤 A: 檢查API金鑰是否正確,確保整合已分享到工作空間
Q: 檔名使用摘要而非標題
A: 這是已知問題,已修復。確保使用最新版本的 real_notion_checker.py
Q: Python依賴安裝失敗 A: 容器環境可能需要特殊處理,指令碼已包含自動安裝邏輯
Q: 定時器不執行 A: 檢查程序狀態,可能需要重啟定時器
./scripts/debug_page_structure.py 檢查API連線FORCE_CHECK=1 ./scripts/simple_checker.sh 手動測試sync_timer.log 日誌檔案修改 real_notion_checker.py 中的 export_page_to_markdown 函式來自定義Markdown格式。
指令碼輸出標準化格式,可輕鬆整合到: - CI/CD流水線 - 其他自動化工具 - 自定義監控系統
歡迎貢獻程式碼、報告問題或提出建議!
# 克隆倉庫
git clone https://github.com/your-username/notion-sync-obsidian.git
# 安裝依賴
pip install -r requirements.txt
# 執行測試
python -m pytest tests/
MIT License - 詳見 LICENSE 檔案
版本: 1.0.0
最後更新: 2026-02-24
維護者: kk (你的私人助理)
狀態: ✅ 生產就緒
這是一個功能相對完整的 Notion 同步工具,文件說明詳細,但部分文件內容有重複,且說明中提到的一些檔案實際缺失。對於需要將 Notion 文章備份到本地 Obsidian 的使用者來說基本可用,但建議先仔細閱讀安裝說明,確保理解配置流程後再使用。