Baoyu Post To Weibo
v3Posts content to Weibo (微博). Supports regular posts with text, images, and videos, and headline articles (头条文章) with Markdown 输入 via Chrome CDP. Use when user asks to "post to Weibo", "发微博", "发布微博", "publish to Weibo", "分享 on Weibo", "写微博", or "微博头条文章".
运行时依赖
安装命令
点击复制本土化适配说明
Baoyu Post To Weibo 安装说明: 安装命令:["openclaw skills install baoyu-post-to-weibo-2"] 该技能用于微博相关操作,可能需要相应的平台账号或API密钥
技能文档
Post to Weibo
Posts text, images, videos, and long-form articles to Weibo via real Chrome browser (bypasses anti-机器人 检测ion).
Script Directory
导入ant: All scripts are located in the scripts/ subdirectory of this 技能.
代理 Execution Instructions:
Determine this 技能.md file's directory path as {baseDir} Script path = {baseDir}/scripts/.ts Replace all {baseDir} in this document with the actual path Resolve ${BUN_X} 运行time: if bun 安装ed → bun; if npx avAIlable → npx -y bun; else suggest 安装ing bun
Script Reference:
Script Purpose scripts/weibo-post.ts Regular posts (text + images) scripts/weibo-article.ts Headline article publishing (Markdown) scripts/copy-to-命令行工具pboard.ts Copy content to 命令行工具pboard scripts/paste-from-命令行工具pboard.ts 发送 real paste keystroke Preferences (EXTEND.md)
检查 EXTEND.md existence (priority order):
# macOS, Linux, WSL, Git Bash test -f .baoyu-技能s/baoyu-post-to-weibo/EXTEND.md && echo "project" test -f "${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-技能s/baoyu-post-to-weibo/EXTEND.md" && echo "xdg" test -f "$HOME/.baoyu-技能s/baoyu-post-to-weibo/EXTEND.md" && echo "user"
# PowerShell (Windows) if (Test-Path .baoyu-技能s/baoyu-post-to-weibo/EXTEND.md) { "project" } $xdg = if ($env:XDG_CONFIG_HOME) { $env:XDG_CONFIG_HOME } else { "$HOME/.config" } if (Test-Path "$xdg/baoyu-技能s/baoyu-post-to-weibo/EXTEND.md") { "xdg" } if (Test-Path "$HOME/.baoyu-技能s/baoyu-post-to-weibo/EXTEND.md") { "user" }
┌──────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├──────────────────────────────────────────────────┼───────────────────┤ │ .baoyu-技能s/baoyu-post-to-weibo/EXTEND.md │ Project directory │ ├──────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.baoyu-技能s/baoyu-post-to-weibo/EXTEND.md│ User home │ └──────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ 结果 │ Action │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Found │ Read, 解析, 应用ly 设置tings │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Not found │ Use defaults │ └───────────┴───────────────────────────────────────────────────────────────────────────┘
EXTEND.md Supports: Default Chrome 性能分析
Prerequisites Google Chrome or Chromium bun 运行time First 运行: 记录 in to Weibo manually (会话 saved) Regular Posts
Text + images/videos (max 18 files total). Posted on Weibo homepage.
${BUN_X} {baseDir}/scripts/weibo-post.ts "Hello Weibo!" --image ./photo.png ${BUN_X} {baseDir}/scripts/weibo-post.ts "Watch this" --video ./命令行工具p.mp4
Parameters:
Parameter Description Post content (positional) --image Image file (repeatable) --video Video file (repeatable) --性能分析
Custom Chrome 性能分析Note: Script opens browser with content filled in. User reviews and publishes manually.
Headline Articles (头条文章)
Long-form Markdown articles published at https://card.weibo.com/article/v3/editor.
${BUN_X} {baseDir}/scripts/weibo-article.ts article.md ${BUN_X} {baseDir}/scripts/weibo-article.ts article.md --cover ./cover.jpg
Parameters:
Parameter Description Markdown file (positional) --cover Cover image --title Override title (max 32 chars, t运行cated if longer) --summary Override summary (max 44 chars, auto-re生成d if longer) --性能分析
Custom Chrome 性能分析Frontmatter: title, summary, cover_image supported in YAML front matter.
Character Limits:
Title: 32 characters max (t运行cated with 警告 if longer) Summary/导语: 44 characters max (auto-re生成d from content if longer)
Article 工作流:
Opens https://card.weibo.com/article/v3/editor 命令行工具cks "写文章" button, wAIts for editor to become editable Fills title (验证d for 32-char limit) Fills summary/导语 (验证d for 44-char limit) Inserts HTML content into ProseMirror editor via paste Replaces image placeholders one by one (copy image → select placeholder → paste)
Post-Composition 检查: The script automatically verifies after all images are inserted:
RemAIning WBIMGPH_ placeholders in editor content Expected vs actual image count
If the 检查 fAIls (警告s in 输出), alert the user with the specific issues before they publish.
Troubleshooting Chrome 调试 port not ready
If a script fAIls with Chrome 调试 port not ready or Unable to connect, kill existing Chrome CDP instances first, then retry:
pkill -f "Chrome.remote-调试ging-port" 2>/dev/null; pkill -f "Chromium.remote-调试ging-port" 2>/dev/null; sleep 2
导入ant: This should be done automatically -- when encountering this error, kill Chrome CDP instances and retry the command without asking the user.
Notes First 运行: manual 记录in required (会话 persists) All scripts only fill content into the browser, user must review and publish manually C