Install
openclaw skills install blogger-auto-publish-cleanAutomatically publish Markdown articles to Google Blogger. Supports batch publishing, draft management, and automatic HTML conversion.
openclaw skills install blogger-auto-publish-clean版本: 1.1.0
发布日期: 2026-03-28
更新日期: 2026-03-28 (Live Implementation)
兼容性: OpenClaw >= 2026.3.0
状态: 生产就绪 ✅
使用此技能前,你必须准备好以下文件:
credentials.json)credentials.json文件token.json自动将Markdown文章发布到Google Blogger博客。支持:
npm install googleapis@latest
credentials.json到项目根目录# 列出所有博客
node list_blogs.js
# 发布文章
node publish.js --file posts/my-article.md
# 管理草稿
node delete-all-drafts.js
blogger-auto-publish/
├── auth.js # 授权模块
├── blogger.js # 主发布模块
├── config.js # 配置文件
├── credentials.json # Google API凭据(用户提供)
├── token.json # 授权token(自动生成)
├── list_blogs.js # 列出博客
├── publish.js # 发布文章
├── delete-all-drafts.js # 删除所有草稿
├── delete-test-posts.js # 删除测试文章
├── direct-delete-drafts.js # 直接删除草稿
├── find-blog-id.js # 查找博客ID
├── complete-auth.js # 完整授权流程
├── index.js # 主入口文件
├── package.json # 项目配置
├── posts/ # 文章目录
│ └── example-post.md # 示例文章
└── scripts/ # 工具脚本
└── setup-blogger.sh # 安装脚本
http://localhost:3000/oauth2callbackcredentials.jsonfind-blog-id.js脚本# 设置环境变量
export BLOG_ID="你的博客ID"
# 运行授权
node auth.js login
# 或使用完整授权脚本
node complete-auth.js
# 发布单篇文章
node publish.js --file posts/my-article.md --title "文章标题"
# 发布为草稿
node publish.js --file posts/draft.md --draft
# 批量发布
for file in posts/*.md; do
node publish.js --file "$file"
done
---
title: 文章标题
labels: 标签1,标签2,标签3
draft: false
---
# 文章内容
这里是文章的Markdown内容...
- 支持标准Markdown语法
- 支持代码块
- 支持图片链接
title: 文章标题(必需)labels: 标签,逗号分隔(可选)draft: 是否作为草稿发布,true/false(可选,默认false)export BLOG_ID="YOUR_BLOG_ID_HERE"
export CREDENTIALS_PATH="./credentials.json"
export TOKEN_PATH="./token.json"
export POSTS_DIR="./posts"
module.exports = {
blogId: process.env.BLOG_ID || "YOUR_BLOG_ID_HERE",
credentialsPath: process.env.CREDENTIALS_PATH || "./credentials.json",
tokenPath: process.env.TOKEN_PATH || "./token.json",
postsDir: process.env.POSTS_DIR || "./posts",
maxRetries: 3,
retryDelay: 1000,
};
授权失败
credentials.json文件是否正确token.json重新授权博客ID错误
find-blog-id.js查找正确ID发布失败
401: 授权无效,重新运行授权403: 权限不足,检查博客权限404: 博客ID错误,验证博客ID429: API配额超限,等待后重试token.jsoncredentials.json如有问题或建议:
references/目录中的详细文档node index.js --help查看帮助当OpenClaw检测到以下需求时自动触发:
此技能已经过完整测试和验证:
credentials.jsontoken.jsongoogleapis@latestauth.js - OAuth授权模块publish.js - 发布主模块config.js - 配置文件package.json - 项目配置README.md - 使用说明posts/example-post.md - 示例文章SETUP.md - 详细设置指南credentials-example.json - 凭据模板文件重要: 此技能不包含任何敏感凭据文件。用户需要按照SETUP.md指南自行配置Google API凭据和博客ID。