baoyu-post-to-weibo by jimliu/baoyu-skills
npx skills add https://github.com/jimliu/baoyu-skills --skill baoyu-post-to-weibo通过真实的 Chrome 浏览器(绕过反机器人检测)发布文本、图片、视频和头条文章到微博。
重要提示:所有脚本都位于此技能的 scripts/ 子目录中。
Agent 执行说明:
{baseDir}{baseDir}/scripts/<script-name>.ts{baseDir} 替换为实际路径${BUN_X} 运行时:如果已安装 bun → bun;如果 npx 可用 → ;否则建议安装 bun广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
npx -y bun脚本参考:
| 脚本 | 用途 |
|---|---|
scripts/weibo-post.ts | 常规发布(文本 + 图片) |
scripts/weibo-article.ts | 头条文章发布(Markdown) |
scripts/copy-to-clipboard.ts | 复制内容到剪贴板 |
scripts/paste-from-clipboard.ts | 发送真实的粘贴按键 |
检查 EXTEND.md 是否存在(优先级顺序):
# macOS, Linux, WSL, Git Bash
test -f .baoyu-skills/baoyu-post-to-weibo/EXTEND.md && echo "project"
test -f "${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-post-to-weibo/EXTEND.md" && echo "xdg"
test -f "$HOME/.baoyu-skills/baoyu-post-to-weibo/EXTEND.md" && echo "user"
# PowerShell (Windows)
if (Test-Path .baoyu-skills/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-skills/baoyu-post-to-weibo/EXTEND.md") { "xdg" }
if (Test-Path "$HOME/.baoyu-skills/baoyu-post-to-weibo/EXTEND.md") { "user" }
┌──────────────────────────────────────────────────┬───────────────────┐ │ 路径 │ 位置 │ ├──────────────────────────────────────────────────┼───────────────────┤ │ .baoyu-skills/baoyu-post-to-weibo/EXTEND.md │ 项目目录 │ ├──────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.baoyu-skills/baoyu-post-to-weibo/EXTEND.md│ 用户主目录 │ └──────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ 结果 │ 操作 │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 找到 │ 读取、解析、应用设置 │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 未找到 │ 使用默认值 │ └───────────┴───────────────────────────────────────────────────────────────────────────┘
EXTEND.md 支持:默认 Chrome 配置文件
bun 运行时文本 + 图片/视频(最多总共 18 个文件)。发布在微博首页。
${BUN_X} {baseDir}/scripts/weibo-post.ts "Hello Weibo!" --image ./photo.png
${BUN_X} {baseDir}/scripts/weibo-post.ts "Watch this" --video ./clip.mp4
参数:
| 参数 | 描述 |
|---|---|
<text> | 发布内容(位置参数) |
--image <path> | 图片文件(可重复) |
--video <path> | 视频文件(可重复) |
--profile <dir> | 自定义 Chrome 配置文件 |
注意:脚本会打开浏览器并填充内容。用户需手动审核并发布。
在 https://card.weibo.com/article/v3/editor 发布长篇 Markdown 文章。
${BUN_X} {baseDir}/scripts/weibo-article.ts article.md
${BUN_X} {baseDir}/scripts/weibo-article.ts article.md --cover ./cover.jpg
参数:
| 参数 | 描述 |
|---|---|
<markdown> | Markdown 文件(位置参数) |
--cover <path> | 封面图片 |
--title <text> | 覆盖标题(最多 32 个字符,超长则截断) |
--summary <text> | 覆盖摘要(最多 44 个字符,超长则自动重新生成) |
--profile <dir> | 自定义 Chrome 配置文件 |
Frontmatter:YAML front matter 支持 title、summary、cover_image。
字符限制:
Markdown 转 HTML:将 markdown 转换为 HTML 时,不要传递任何 --theme 参数。使用默认主题(不传递主题参数)。
文章工作流程:
https://card.weibo.com/article/v3/editor发布后检查:脚本在所有图片插入后会自动验证:
WBIMGPH_ 占位符如果检查失败(输出中有警告),在用户发布前,用具体问题提醒用户。
如果脚本因 Chrome debug port not ready 或 Unable to connect 失败,请先终止现有的 Chrome CDP 实例,然后重试:
pkill -f "Chrome.*remote-debugging-port" 2>/dev/null; pkill -f "Chromium.*remote-debugging-port" 2>/dev/null; sleep 2
重要提示:这应该自动完成——当遇到此错误时,终止 Chrome CDP 实例并重试命令,无需询问用户。
通过 EXTEND.md 进行自定义配置。有关路径和支持的选项,请参阅偏好设置部分。
每周安装
5.6K
仓库
GitHub 星标
11.8K
首次出现
2026年3月6日
安全审计
安装于
opencode5.5K
codex5.5K
gemini-cli5.5K
cursor5.5K
github-copilot5.5K
amp5.5K
Posts text, images, videos, and long-form articles to Weibo via real Chrome browser (bypasses anti-bot detection).
Important : All scripts are located in the scripts/ subdirectory of this skill.
Agent Execution Instructions :
{baseDir}{baseDir}/scripts/<script-name>.ts{baseDir} in this document with the actual path${BUN_X} runtime: if bun installed → bun; if npx available → npx -y bun; else suggest installing bunScript Reference :
| 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 |
Check EXTEND.md existence (priority order):
# macOS, Linux, WSL, Git Bash
test -f .baoyu-skills/baoyu-post-to-weibo/EXTEND.md && echo "project"
test -f "${XDG_CONFIG_HOME:-$HOME/.config}/baoyu-skills/baoyu-post-to-weibo/EXTEND.md" && echo "xdg"
test -f "$HOME/.baoyu-skills/baoyu-post-to-weibo/EXTEND.md" && echo "user"
# PowerShell (Windows)
if (Test-Path .baoyu-skills/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-skills/baoyu-post-to-weibo/EXTEND.md") { "xdg" }
if (Test-Path "$HOME/.baoyu-skills/baoyu-post-to-weibo/EXTEND.md") { "user" }
┌──────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├──────────────────────────────────────────────────┼───────────────────┤ │ .baoyu-skills/baoyu-post-to-weibo/EXTEND.md │ Project directory │ ├──────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.baoyu-skills/baoyu-post-to-weibo/EXTEND.md│ User home │ └──────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ Result │ Action │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Found │ Read, parse, apply settings │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Not found │ Use defaults │ └───────────┴───────────────────────────────────────────────────────────────────────────┘
EXTEND.md Supports : Default Chrome profile
bun runtimeText + 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 ./clip.mp4
Parameters :
| Parameter | Description |
|---|---|
<text> | Post content (positional) |
--image <path> | Image file (repeatable) |
--video <path> | Video file (repeatable) |
--profile <dir> | Custom Chrome profile |
Note : Script opens browser with content filled in. User reviews and publishes manually.
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> | Markdown file (positional) |
--cover <path> | Cover image |
--title <text> | Override title (max 32 chars, truncated if longer) |
--summary <text> | Override summary (max 44 chars, auto-regenerated if longer) |
--profile <dir> | Custom Chrome profile |
Frontmatter : title, summary, cover_image supported in YAML front matter.
Character Limits :
Markdown-to-HTML : Do NOT pass any --theme parameter when converting markdown to HTML. Use the default theme (no theme argument).
Article Workflow :
https://card.weibo.com/article/v3/editorPost-Composition Check : The script automatically verifies after all images are inserted:
WBIMGPH_ placeholders in editor contentIf the check fails (warnings in output), alert the user with the specific issues before they publish.
If a script fails with Chrome debug port not ready or Unable to connect, kill existing Chrome CDP instances first, then retry:
pkill -f "Chrome.*remote-debugging-port" 2>/dev/null; pkill -f "Chromium.*remote-debugging-port" 2>/dev/null; sleep 2
Important : This should be done automatically -- when encountering this error, kill Chrome CDP instances and retry the command without asking the user.
Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
Weekly Installs
5.6K
Repository
GitHub Stars
11.8K
First Seen
Mar 6, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykWarn
Installed on
opencode5.5K
codex5.5K
gemini-cli5.5K
cursor5.5K
github-copilot5.5K
amp5.5K
102,200 周安装