← Back to Skills Marketplace
279458179

baijiahao-publisher

by xiaohuozi · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
84
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install baijiahao-publisher
Description
基于 OpenClaw 内置浏览器的百家号发布技能。打开发布页、扫码登录、填标题/正文、上传封面图、发布,全自动。零依赖 Python,任意 OpenClaw 环境均可运行。
README (SKILL.md)

百家号发布(浏览器版)

概述

本 Skill 使用 OpenClaw 内置浏览器完成百家号文章发布,无需 Python/Playwright,任意 OpenClaw 环境均可运行。

完整工作流

Step 1 — 启动浏览器

browser(action="start", profile="openclaw")

Step 2 — 打开发布页

browser(action="open", profile="openclaw", url="https://baijiahao.baidu.com/builder/rc/edit?type=news&is_from_cms=1")

Step 3 — 处理登录

检查页面是否有登录弹窗:

  • 如果有登录对话框:请用户在浏览器中扫码登录(百家号APP或百度APP)。登录成功后告知助手。
  • 如果页面已登录:直接进入 Step 4。

Step 4 — 关闭新手提示

按 Escape 或点击「知道了/关闭」按钮,关闭常见新手提示弹窗。

Step 5 — 填入标题

  1. browser(action="snapshot") 获取当前页面元素
  2. 找到标题输入框(placeholder 含"请输入标题"),点击激活
  3. browser(action="act", request={"kind": "type", "ref": "\x3C标题元素ref>", "text": "\x3C文章标题>"})

Step 6 — 填入正文

正文在 iframe 内,需要通过 iframe 操作:

  1. 点击 iframe 中的段落元素激活编辑区
  2. browser(action="act", request={"kind": "type", "ref": "\x3C正文元素ref>", "text": "\x3C正文内容>"})
  3. 支持分段输入(每段后换行)

Step 7 — 设置封面(核心步骤)

封面必须上传图片文件,步骤如下:

  1. 复制图片到上传目录: 将用户提供/AI生成的封面图复制到 C:\Users\Administrator\AppData\Local\Temp\openclaw\uploads\cover.jpg

  2. 打开封面上传弹窗: 点击「选择封面」按钮

  3. 点击「本地上传」触发文件选择: 通过 browser(action="snapshot") 找到正文/本地上传 tab

  4. 上传文件

    browser(action="upload", paths=["C:\\Users\\Administrator\\AppData\\Local\\Temp\\openclaw\\uploads\\cover.jpg"])
    
  5. 确认封面: 点击「确定」按钮应用封面

自动生成封面(可选): 若用户未提供封面图,可调用 image_generate 生成后保存再用上述方式上传。

Step 8 — 勾选 AI 声明

在右侧面板找到「采用AI生成内容」复选框并勾选。

Step 9 — 发布

  1. 点击「发布」按钮
  2. 若出现验证/提示,等待处理完成
  3. 页面显示「文章发布成功」即为完成

关键实现细节

文件上传流程(必须严格按顺序)

1. browser(action="snapshot") → 找到封面上传弹窗的 ref
2. browser(action="act", kind="click", ref="\x3C上传区域ref>") → 激活文件 input
3. 复制图片到: C:\Users\Administrator\AppData\Local\Temp\openclaw\uploads\cover.jpg
4. browser(action="upload", paths=["C:\\Users\\Administrator\\AppData\\Local\\Temp\\openclaw\\uploads\\cover.jpg"])
5. browser(action="snapshot") → 确认图片已出现在预览中
6. 点击「确定」

封面弹窗判断

封面弹窗有两种状态:

  • 第一次打开:tab 显示「正文/本地上传」
  • 已上传过一张图后:tab 显示「正文/本地上传(1)」

两种状态下的「确定」按钮 ref 不同,需 snapshot 确认后再点。

Cookie 注入(备选方案)

如需绕过扫码登录,可尝试注入 cookie:

browser(action="act", request={
  "kind": "evaluate",
  "fn": "document.cookie='\x3Ccookie string>'"
})

但百家号 cookie 有效期短,建议优先使用扫码登录。

iframe 内操作

正文编辑器在 iframe 内,browser(action="snapshot") 的 ref 前缀为 f37e 开头。


调用约定

当用户提供以下任意意图时,使用本 Skill:

  • 「帮我发布百家号文章」
  • 「把 xxx 发布到百家号」
  • 「上传图片发布百家号」
  • 「生成一篇 xxx 的文章并发布」

Agent 应自动解析参数:

  • 标题:从用户请求或生成内容中提取
  • 正文:用户提供的文本或 AI 生成的完整文章
  • 封面:用户提供图片路径,或用 image_generate 生成

发布通道状态码

状态 含义
显示「文章发布成功」 发布完成
显示「内容已存入草稿」 存草稿成功,需人工确认后发布
显示「请添加封面」 封面未上传,需补封面后发布
显示「提交成功,正在审核中」 已提交审核

文件结构

baijiahao-browser/
├── SKILL.md          # 本文件
├── _meta.json        # 元数据
└── package.json      # 包信息
Usage Guidance
This skill appears to do what it says (automate Baijiahao publishing via the built-in browser), but there are important mismatches you should understand before installing: - Hard-coded Windows path: The SKILL.md requires copying the cover image to C:\Users\Administrator\AppData\Local\Temp\openclaw\uploads\cover.jpg. If your OpenClaw environment is not Windows or uses a different temp/profile path, the upload step will fail or the agent may attempt to access unexpected locations. Ask the author to make the upload path configurable or to use a cross-platform temp location. - Cookie injection is sensitive: The doc suggests bypassing login by injecting a cookie string (document.cookie='...'). Do NOT provide session cookies unless you fully trust the skill and understand the risk — cookies are credentials that grant account access. Prefer manual QR login as recommended. - Undeclared filesystem access: The package metadata doesn't list any required config paths or credentials, yet the workflow requires reading/writing local files. Confirm where the skill will write files and whether the agent will request access to your filesystem. - What to ask the author / what to change: require the skill to declare the config path(s) it needs and make paths configurable; remove or better qualify the cookie-injection fallback; explicitly state OS compatibility (Windows-only vs cross-platform); and add an explicit prompt/consent step before reading/writing local files or accepting cookies. If you still want to use it: run in a disposable/test environment first, never share session cookies, and inspect logs or prompts during the first run to confirm what paths the agent reads/writes. If you are uncomfortable with these issues, do not provide account cookies and ask for a revised skill that exposes its file-path and credential needs transparently.
Capability Analysis
Type: OpenClaw Skill Name: baijiahao-publisher Version: 1.0.0 The skill is a browser automation tool designed to automate article publishing on the Baijiahao platform. It utilizes standard OpenClaw browser actions (start, open, act, upload, snapshot) to navigate the site, handle login, and fill in content. While it contains a hardcoded Windows-specific temporary path (C:\Users\Administrator\AppData\Local\Temp\openclaw\uploads\cover.jpg) and mentions cookie injection as a login bypass method, these behaviors are consistent with the stated purpose of web automation and do not exhibit signs of malicious intent, data exfiltration, or unauthorized access.
Capability Assessment
Purpose & Capability
The skill claims to be zero-dependency and runnable on any OpenClaw environment, but the SKILL.md hard-codes a Windows-specific upload path (C:\Users\Administrator\AppData\Local\Temp\openclaw\uploads\cover.jpg). The metadata declared no required config paths or credentials, yet the instructions depend on local filesystem write access and the built-in browser capability. This is an incoherence: either the skill should declare that it requires access to that path (and document cross-platform behavior) or avoid hard-coded OS-specific paths.
Instruction Scope
Runtime instructions tell the agent to copy user/AI-generated images into a specific local path and then call browser(action="upload") against that path — i.e., the agent will need file system access to arbitrary files. The SKILL.md also documents a 'cookie injection' fallback using document.cookie (browser(action="act"... evaluate ...)), which explicitly directs the agent to set session cookies in the page. Cookie injection is effectively asking for session credentials and is sensitive. These behaviors are outside what the package metadata advertises and broaden the skill's scope (file access + credential handling).
Install Mechanism
The skill is instruction-only (no install spec, no code files to execute), which reduces risk from arbitrary installs or downloaded code. There are no external URLs or package installs referenced.
Credentials
The registry metadata lists no required environment variables or config paths, yet SKILL.md expects access to a specific filesystem location and suggests optionally injecting cookies (sensitive secrets). Requesting cookie strings or directing users to place files in a privileged path is disproportionate to the declared requirements and should be explicitly declared and justified.
Persistence & Privilege
The skill is not marked always:true and does not request persistent system-wide changes. It does not appear to modify other skills or global agent settings based on the provided materials.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install baijiahao-publisher
  3. After installation, invoke the skill by name or use /baijiahao-publisher
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Major update: browser-based automation added, enabling fully automated Baijiahao publishing across all OpenClaw environments. - Skill renamed from "baijiahao-publisher" to "baijiahao-browser". - Now uses the built-in OpenClaw browser; no Python or Playwright required. - Supports automated: page navigation, QR code login, title/content entry, cover image upload, and article publishing. - Provides detailed and robust workflow steps, including advanced cover image handling and cookie injection options. - Can be invoked by user intent (e.g., "帮我发布百家号文章") with intelligent parameter extraction. - New status codes help clarify publishing results (e.g., success, draft, missing cover).
Metadata
Slug baijiahao-publisher
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is baijiahao-publisher?

基于 OpenClaw 内置浏览器的百家号发布技能。打开发布页、扫码登录、填标题/正文、上传封面图、发布,全自动。零依赖 Python,任意 OpenClaw 环境均可运行。 It is an AI Agent Skill for Claude Code / OpenClaw, with 84 downloads so far.

How do I install baijiahao-publisher?

Run "/install baijiahao-publisher" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is baijiahao-publisher free?

Yes, baijiahao-publisher is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does baijiahao-publisher support?

baijiahao-publisher is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created baijiahao-publisher?

It is built and maintained by xiaohuozi (@279458179); the current version is v1.0.0.

💬 Comments