← 返回 Skills 市场
277
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install csdn-publish
功能描述
CSDN 文章发布技能
使用说明 (SKILL.md)
CSDN 文章发布技能
描述
自动化发布文章到 CSDN 博客平台。支持打开编辑器、填写标题和内容、发布文章。
触发条件
当用户要求:
- 发布文章到 CSDN
- 在 CSDN 写博客
- 发布技术文章到 CSDN 平台
发布流程
1. 打开 CSDN 编辑器
browser.open(
url="https://mp.csdn.net/mp_blog/creation/editor?spm=1010.2135.3001.4503",
profile="openclaw"
)
2. 检查登录状态
使用 browser.snapshot 检查页面状态:
- 如果看到登录框/验证码 → 停止任务,告知用户需要先登录
- 如果看到编辑器界面(标题输入框、工具栏)→ 继续
3. 填写文章标题
找到标题输入框(aria ref 通常为 e41),使用 browser.act 填写:
browser.act(
kind="type",
ref="e41",
text="文章标题"
)
4. 填写文章内容
点击编辑器内容区域(iframe 内的 f1e1),然后输入 Markdown 格式的文章内容:
browser.act(
kind="click",
ref="f1e1"
)
browser.act(
kind="type",
ref="f1e1",
text="完整的 Markdown 文章内容"
)
5. 点击发布按钮
找到发布按钮(aria ref 通常为 e322),点击发布:
browser.act(
kind="click",
ref="e322"
)
6. 确认发布结果
再次使用 browser.snapshot 检查发布结果:
- 如果看到"发布成功!正在审核中" → 成功
- 提取文章链接告知用户
注意事项
- 登录检查:必须先确认用户已登录 CSDN,否则无法发布
- 内容格式:支持 Markdown 格式,包括代码块、标题、列表等
- 标题要求:5-100 个字符
- 审核机制:发布后需要审核,审核通过后才能公开可见
- 浏览器配置:使用
profile="openclaw"确保浏览器可用
文章链接提取
发布成功后,从页面中提取文章链接(通常在 查看文章 按钮的 href 中),格式类似:
https://blog.csdn.net/{username}/article/details/{article_id}
错误处理
| 情况 | 处理方式 |
|---|---|
| 未登录 | 停止任务,提示用户先登录 CSDN |
| 标题太短 | 提示用户标题至少 5 个字符 |
| 内容为空 | 提示用户需要填写文章内容 |
| 网络错误 | 重试或提示用户检查网络 |
示例调用
用户:帮我发布一篇 Python 教程到 CSDN
助手:
- 打开编辑器页面
- 检查登录状态 ✓
- 填写标题"Python 入门教程"
- 填写完整的教程内容
- 点击发布
- 返回文章链接
安全使用建议
This skill appears to do what it says (automate publishing to CSDN) and does not ask for unrelated secrets or installs. Before installing or using it, consider: 1) Make sure the browser profile it will use is the account you intend to publish from — the skill will act with that profile's logged-in session. 2) Provide and review article content carefully (avoid posting passwords or private info). 3) Because the instructions target specific page element refs and an iframe, the automation can break if CSDN changes its editor; test on a draft or private post first. 4) Prefer an explicit confirmation/preview step before the final publish click; if the skill does not prompt, manually confirm before invoking the publish action. If you want extra assurance, manually publish or use the skill only for draft uploads until you're comfortable with its behavior.
功能分析
Type: OpenClaw Skill
Name: csdn-publish
Version: 1.0.0
The skill bundle provides legitimate automation for publishing articles to the CSDN platform. It uses standard browser automation commands (browser.open, browser.act, browser.snapshot) to interact with the official CSDN creator center (mp.csdn.net) and includes appropriate checks for login status and content requirements in SKILL.md.
能力评估
Purpose & Capability
The name/description (publish articles to CSDN) match the instructions: open CSDN editor, check login, fill title/content, click publish, and extract the article link. No unrelated binaries, env vars, or installs are requested.
Instruction Scope
Instructions are narrowly scoped to browser automation on the CSDN editor and include sensible checks (login, success message). Notes of caution: (1) the steps assume specific DOM refs (e41, f1e1, e322) and an iframe which may be brittle across page changes; (2) the flow does not explicitly require a final user confirmation/preview before clicking publish (it assumes the user's initial trigger implies consent), which could lead to accidental publishing of unintended content.
Install Mechanism
Instruction-only skill with no install spec, no downloads, and no code files — minimal install risk.
Credentials
No environment variables or credentials are requested, which is appropriate. However, the skill requires using a browser profile (profile="openclaw"); that profile provides access to the user's logged-in session (cookies/tokens). This is expected for a publishing action but is the effective mechanism by which the skill acts on the user's CSDN account, so users should understand the agent will operate with that session's privileges.
Persistence & Privilege
always is false and the skill does not request persistent or system-wide changes. Autonomous invocation is allowed by default (normal for skills) and does not by itself raise additional concern here.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install csdn-publish - 安装完成后,直接呼叫该 Skill 的名称或使用
/csdn-publish触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
CSDN 文章发布技能 v1.0.0
- 需要先自行完成账号登录,后续自动化将文章发布到 CSDN 博客平台。
- 实现了自动打开编辑器、填写标题与内容、点击发布、检查发布结果的完整流程。
- 支持 Markdown 格式内容,自动校验登录状态、标题长度、内容非空。
- 成功发布后自动返回文章链接。
- 增加详细的错误处理和操作示例。
元数据
常见问题
CSDN 文章发布 是什么?
CSDN 文章发布技能. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 277 次。
如何安装 CSDN 文章发布?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install csdn-publish」即可一键安装,无需额外配置。
CSDN 文章发布 是免费的吗?
是的,CSDN 文章发布 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
CSDN 文章发布 支持哪些平台?
CSDN 文章发布 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 CSDN 文章发布?
由 echome123(@echome123)开发并维护,当前版本 v1.0.0。
推荐 Skills