拾流 / 微博图文与头条文章发布 · 创作技能

SHILIU · 创作资源

微博图文与头条文章发布 · 创作技能

通过真实 Chrome 浏览器(CDP)把文字、图片、视频或 Markdown 头条文章填入微博编辑器,由用户人工复核并点击发布。含占位符残留与图片数量校验、Chrome 调试实例的定向清理说明。不自动提交,不保证平台审核结果。

拾流编辑部 · 更新于 2026-11-02

这个技能解决什么问题

通过真实 Chrome 浏览器(CDP)把文字、图片、视频或 Markdown 头条文章填入微博编辑器,由用户人工复核并点击发布。含占位符残留与图片数量校验、Chrome 调试实例的定向清理说明。不自动提交,不保证平台审核结果。

适用任务

把已写好的微博正文(可带图片/视频)或 Markdown 头条文章填入微博网页编辑器,供用户人工确认后发布。

需要的输入

微博正文文本或 .md 文件;可选图片/视频本地路径(普通帖合计不超过 18 个文件);头条文章可选封面图、标题(≤32 字)、导语(≤44 字);本机已安装 Chrome/Chromium 与 bun(或可用 npx);用户已在首次运行时手动登录微博。

交付内容

浏览器中已填好内容的微博发布页或头条文章编辑器;脚本输出的占位符残留报告与期望/实际图片数量对比;用户人工发布后的最终帖子(由用户操作产生)。

任务示例

用 baoyu-post-to-weibo 把 ./draft/post.md 发成微博头条文章,封面用 ./draft/cover.jpg,标题用 frontmatter 里的,先别发布,填好后把占位符检查结果告诉我。

输出示例

(示意,非真实运行结果)1) 已打开 card.weibo.com 编辑器并填入标题与导语;2) 正文已粘贴,图片占位符 WBIMGPH_1..3 已逐个替换;3) 检查报告:剩余占位符 0,期望图片 3 / 实际 3;4) 等待你在页面上确认后手动点击发布。

来源与使用

作者 宝玉 · JimLiu;许可 MIT。已核对来源与包结构,未据此宣称完成运行实测。

查看原始来源

机器可读详情 · 读取 SKILL.md · 下载完整技能包

技能说明全文

---
name: baoyu-post-to-weibo
description: Posts content to Weibo (微博). Supports regular posts with text, images, and videos, and headline articles (头条文章) with Markdown input via Chrome CDP. Use when user asks to "post to Weibo", "发微博", "发布微博", "publish to Weibo", "share on Weibo", "写微博", or "微博头条文章".
version: 1.117.3
metadata:
  openclaw:
    homepage: https://github.com/JimLiu/baoyu-skills#baoyu-post-to-weibo
    requires:
      anyBins:
        - bun
        - npx
---

# Post to Weibo

Posts via a real Chrome browser (CDP), which avoids anti-bot detection. Scripts only fill content in the browser — the user reviews and publishes manually.

## Script Directory

`{baseDir}` = this SKILL.md's directory; scripts are at `{baseDir}/scripts/<script-name>.ts`. Resolve `${BUN_X}`: `bun` if installed → else `npx -y bun` → else suggest installing bun.

| Script | Purpose |
|--------|---------|
| `scripts/weibo-post.ts` | Regular posts (text + images) |
| `scripts/weibo-article.ts` | Headline article publishing (Markdown) |
| `scripts/copy-to-clipboard.ts` | Copy content to clipboard |
| `scripts/paste-from-clipboard.ts` | Send real paste keystroke |

## Preferences (EXTEND.md)

First found wins:

| Priority | Path | Scope |
|----------|------|-------|
| 1 | `.baoyu-skills/baoyu-post-to-weibo/EXTEND.md` | Project |
| 2 | `${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-post-to-weibo/EXTEND.md` | XDG |
| 3 | `$HOME/.baoyu-skills/baoyu-post-to-weibo/EXTEND.md` | User home |

None found → use defaults. Supported: default Chrome profile.

## Prerequisites

Google Chrome or Chromium; `bun`. First run: user logs in to Weibo manually (session persists). Works on macOS, Linux, Windows.

## Post Type Selection

Unless the user specifies: Markdown file (`.md`) → Headline Article (头条文章); plain text / text with images → Regular Post.

## Regular Posts

Text + images/videos (max 18 files total), posted on the Weibo homepage.

```bash
${BUN_X} {baseDir}/scripts/weibo-post.ts "Hello Weibo!" --image ./photo.png
${BUN_X} {baseDir}/scripts/weibo-post.ts "Watch this" --video ./clip.mp4
```

| Parameter | Description |
|-----------|-------------|
| `<text>` | Post content (positional) |
| `--image <path>` | Image file (repeatable) |
| `--video <path>` | Video file (repeatable) |
| `--profile <dir>` | Custom Chrome profile |

## Headline Articles (头条文章)

Editor: `https://card.weibo.com/article/v3/editor`.

```bash
${BUN_X} {baseDir}/scripts/weibo-article.ts article.md
${BUN_X} {baseDir}/scripts/weibo-article.ts article.md --cover ./cover.jpg
```

| Parameter | Description |
|-----------|-------------|
| `<markdown>` | Markdown file (positional) |
| `--cover <path>` | Cover image |
| `--title <text>` | Override title (max 32 chars, truncated with warning if longer) |
| `--summary <text>` | Override summary/导语 (max 44 chars, auto-regenerated from content if longer) |
| `--profile <dir>` | Custom Chrome profile |

Frontmatter: `title`, `summary`, `cover_image`.

**Markdown-to-HTML**: do NOT pass any `--theme` when converting; use the default theme.

Script flow: opens the editor → clicks "写文章" and waits until editable → fills title and summary → pastes HTML into the ProseMirror editor → replaces image placeholders one by one (copy image → select placeholder → paste).

**Post-composition check**: the script then reports remaining `WBIMGPH_` placeholders and expected vs actual image count. If it prints warnings, tell the user the specific issues before they publish.

## Troubleshooting

**`Chrome debug port not ready` / `Unable to connect`**: automatically, without asking, kill only the CDP Chrome instances (with `--remote-debugging-port` AND the baoyu-skills profile), then retry:

```bash
pkill -f "remote-debugging-port.*baoyu-skills/chrome-profile" 2>/dev/null; sleep 2
```

**Never kill all Chrome processes** (`pkill -f "Google Chrome"`) — the user may have regular Chrome windows open.

## Extension Support

Custom configuration via EXTEND.md — see Preferences.

技能是任务材料,不会自动授予账户权限、付费授权或其他系统权限。请让 Agent 按说明核对依赖,再在授权范围内使用。

把这个任务交给你的 Agent

数据、技能和创作空间,一起备好。复制接入指令,发给你正在使用的 AI 工具。

阅读 Agent 接入指南
正在复制指令

粘贴发给你的 Agent
让它成为你的自媒体专家

打开你正在使用的 AI 工具,把下面这段话粘贴到对话框并发送。

发给 Agent 的完整指令

发送后,告诉它你想做什么账号、实现什么目标。

这些 Agent 都可以使用24 个工具