Are you the author? Sign in to claim
多平台文章统一发布 Skill — 支持 CSDN、51CTO、博客园、掘金一键分发
一个 Claude Code Skill,让 AI 帮你把文章一键分发到 CSDN、51CTO、博客园、掘金四个平台。
你说"发篇文章到所有平台",Claude 自动完成凭证检查、模板选型、内容准备、逐平台发布、结果汇总。
作为一个技术博主,我经常遇到这样的场景:写了一篇文章,为了覆盖更多读者,需要在 CSDN、掘金、博客园、51CTO 等多个平台分别发布。每个平台的编辑器都不一样——有的用 HTML、有的用 Markdown、有的格式渲染还有自己的「癖好」。更别提各个平台的 API 鉴权方式五花八门:CSDN 需要算 CA 签名头,掘金的标签要传数字 ID……每次发布都是一次重复劳动。
这个 Skill 就是为了解决这个问题而生的——把「发文章到多个平台」这件事,变成一句话就能搞定的事情。
pip install本项目就是一个开箱即用的 Skill,包含完整的编排流程(SKILL.md)、各平台发帖脚本和配置指南。
# 克隆到本地
git clone https://github.com/lainXXX/blog-auto-poster-skill.git
cd blog-auto-poster-skill
# 配置凭证
cp .env.example .env
# 编辑 .env 填入各平台 Cookie...
然后在 Claude Code 中引用此 Skill:
# Claude Code 中直接说:
# "帮我把这篇文章发布到所有平台"
# "把这个 MD 文件发到 CSDN 和掘金"
# "用工具推荐的模板写一篇文章发到全部平台"
Skill 内置的编排流程会按以下顺序处理:
.env 中各平台 Cookie 是否完备对 Claude Code 说这些话即可自动触发:
不使用 Claude Code 也可以直接调用:
# 单平台
python scripts/csdn_poster.py post --title "标题" --file article.md --format markdown --publish
# 多平台(逐个执行,失败不中断)
python scripts/csdn_poster.py post --title "标题" --file article.md --format markdown --publish
python scripts/51cto_poster.py post --title "标题" --file article.md --tags "Python,后端"
python scripts/cnblogs_poster.py post --title "标题" --file article.md --tags "Python,后端"
python scripts/juejin_poster.py post --title "标题" --file article.md --brief "摘要"
所有脚本仅依赖 Python 3.8+ 标准库,零第三方依赖。
| 平台 | 输入格式 | 鉴权方式 | 草稿支持 | 特殊限制 |
|---|---|---|---|---|
| CSDN | Markdown → 自动转 HTML | Cookie + CA 签名头 | 不加 --publish 即为草稿 | 标签上限 5 个 |
| 51CTO | Markdown → 自动转 HTML | 仅 Cookie | 无真正草稿模式 | CSRF Token 自动获取 |
| 博客园 | 原生 Markdown | 仅 Cookie | --draft | XSRF Token 自动刷新 |
| 掘金 | 原生 Markdown | 仅 Cookie | --draft-only | 频率限制严格,标签支持名称自动映射 |
cp .env.example .env
编辑 .env,填入各平台的 Cookie(从浏览器 F12 获取):
| 平台 | 文档 | 关键字段 |
|---|---|---|
| CSDN | references/csdn.md | Cookie + 4 个 CA 头 |
| 51CTO | references/51cto.md | Cookie(PHPSESSID 等) |
| 博客园 | references/cnblogs.md | Cookie(.CNBlogsCookie 等) |
| 掘金 | references/juejin.md | Cookie(passport_csrf_token 等) |
通用获取方法:F12 → 网络(Network) → 任意请求 → 请求头(Request Headers) → 复制 Cookie 字段。
blog-auto-poster-skill/
├── SKILL.md ← 编排流程(Skill 入口,Claude Code 读取)
├── .env.example ← 凭证模板
├── .gitignore
├── LICENSE
├── README.md
├── scripts/ ← 各平台发帖脚本
│ ├── csdn_poster.py
│ ├── 51cto_poster.py
│ ├── cnblogs_poster.py
│ └── juejin_poster.py
├── references/ ← 各平台注意事项与凭证获取指南
│ ├── csdn.md
│ ├── 51cto.md
│ ├── cnblogs.md
│ └── juejin.md
└── templates/ ← 文章模板(6 种)
├── default.md
├── troubleshooting.md
├── comparison.md
├── deep-dive.md
├── tool-review.md
└── summary.md
Skill 内置 6 种发帖模板,覆盖常见博客场景:
| 模板 | 适用场景 |
|---|---|
default | 通用技术文章 |
tool-review | 工具/软件推荐测评 |
deep-dive | 底层原理/源码深度解析 |
comparison | 技术选型对比分析 |
troubleshooting | 踩坑记录/排错指南 |
summary | 知识总结/学习笔记 |
| 问题 | 解决方法 |
|---|---|
| CSDN 401/403 | Cookie 或 CA 头过期,重新从浏览器获取 |
| 51CTO "请选择授权分类" | 在 .env 设置 51CTO_DEFAULT_CATE_ID |
| 博客园 403 | Cookie 过期,重新获取 |
| 掘金 "err_no: 1002" | 频率过快,等待 30 秒以上重试 |
| 掘金 "err_no: 1" | Cookie 失效,重新登录获取 |
完整排查指南见 references/ 目录下各平台的文档。
欢迎贡献!
scripts/ 下新建发帖脚本,在 references/ 下添加对应文档,更新 .env.example 配置项MIT © 2026 remCoding
Playwright testing toolkit — test generation, flaky test fix, migration helpers
1000+ skills curated from Anthropic, Vercel, Stripe, and other engineering teams
Design enforcement with memory — keeps your UI consistent across a project
Detects 37 AI writing patterns and rewrites text with human rhythm across 5 voice profiles