# Baoyu Post To Weibo > Publica en Weibo texto, imágenes y vídeos, y artículos de cabecera (头条文章) en Markdown, usando Chrome vía CDP para evitar la detección anti-bot. Fuente: https://skillsagentes.com/skills/jimliu/baoyu-skills/baoyu-post-to-weibo Markdown: https://skillsagentes.com/skills/jimliu/baoyu-skills/baoyu-post-to-weibo.md Repositorio: https://github.com/JimLiu/baoyu-skills Autor: JimLiu Licencia: MIT Actualizado: hace 2 meses Coste de contexto: 76 tok instalada, 1.4k tok al activarse, 28.6k tok con todos los archivos del bundle Bundle: 9 archivos, 112 KB Permisos que pide: ninguno declarado ## Instalación Un skill son archivos markdown: los mismos archivos valen para cualquier agente y lo único que cambia es el directorio de destino, es decir la bandera `--agent`. Añade `-g` para instalarlo en todos los proyectos de la máquina. ```bash # Claude Code npx -y skills add JimLiu/baoyu-skills --skill baoyu-post-to-weibo --agent claude-code # Cursor npx -y skills add JimLiu/baoyu-skills --skill baoyu-post-to-weibo --agent cursor # Codex npx -y skills add JimLiu/baoyu-skills --skill baoyu-post-to-weibo --agent codex # Gemini CLI npx -y skills add JimLiu/baoyu-skills --skill baoyu-post-to-weibo --agent gemini # Windsurf npx -y skills add JimLiu/baoyu-skills --skill baoyu-post-to-weibo --agent windsurf # Cline npx -y skills add JimLiu/baoyu-skills --skill baoyu-post-to-weibo --agent cline ``` ## Qué hace - Abre Chrome real vía CDP y rellena publicaciones de Weibo con texto, imágenes o vídeos - Publica artículos de cabecera (头条文章) en card.weibo.com convirtiendo Markdown a HTML - Valida límites de título (32 caracteres) y resumen/导语 (44 caracteres) en artículos - Verifica que no queden placeholders WBIMGPH_ sin reemplazar tras insertar imágenes - Deja el contenido listo en el navegador para que el usuario revise y publique manualmente ## Cuándo usarla - El usuario pide publicar en Weibo, 发微博, 发布微博 o compartir en Weibo - Se quiere publicar un artículo largo en Markdown como 头条文章 (headline article) - Hay que subir texto junto con imágenes o vídeos (hasta 18 archivos) a Weibo ## Qué la activa - "Publica este texto en Weibo con estas fotos" - "Sube este artículo en Markdown como 头条文章 en Weibo" - "发微博: comparte esta actualización con un vídeo" ## Antes de instalar - Requiere Google Chrome/Chromium, el runtime bun (o npx), y haber iniciado sesión manualmente en Weibo la primera vez. - Variables de entorno: BUN_X, JSON, MAX_FILES, SUMMARY_MAX_LENGTH, TITLE_MAX_LENGTH, WSL_DISTRO_NAME - makes network requests - reads environment config ## Archivos - SKILL.md — 5 KB - scripts/bun.lock — 23 KB - scripts/copy-to-clipboard.ts — 12 KB - scripts/md-to-html.ts — 6 KB - scripts/package.json — 167 B - scripts/paste-from-clipboard.ts — 6 KB - scripts/weibo-article.ts — 46 KB - scripts/weibo-post.ts — 10 KB - scripts/weibo-utils.ts — 4 KB ## SKILL.md Reproducido tal cual desde JimLiu/baoyu-skills bajo MIT. Esta sección es el documento original y está en inglés. # Post to Weibo Posts text, images, videos, and long-form articles to Weibo via real Chrome browser (bypasses anti-bot detection). ## Script Directory **Important**: All scripts are located in the `scripts/` subdirectory of this skill. **Agent Execution Instructions**: 1. Determine this SKILL.md file's directory path as `{baseDir}` 2. Script path = `{baseDir}/scripts/.ts` 3. Replace all `{baseDir}` in this document with the actual path 4. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun **Script 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 | ## Preferences (EXTEND.md) Check EXTEND.md in priority order — the first one 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 | If none found, use defaults. **EXTEND.md supports**: Default Chrome profile ## Prerequisites - Google Chrome or Chromium - `bun` runtime - First run: log in to Weibo manually (session saved) --- ## Regular Posts Text + images/videos (max 18 files total). Posted on 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 ``` **Parameters**: | Parameter | Description | |-----------|-------------| | `` | Post content (positional) | | `--image ` | Image file (repeatable) | | `--video ` | Video file (repeatable) | | `--profile ` | Custom Chrome profile | **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`. ```bash ${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, truncated if longer) | | `--summary ` | Override summary (max 44 chars, auto-regenerated if longer) | | `--profile ` | Custom Chrome profile | **Frontmatter**: `title`, `summary`, `cover_image` supported in YAML front matter. **Character Limits**: - Title: 32 characters max (truncated with warning if longer) - Summary/导语: 44 characters max (auto-regenerated from content if longer) **Markdown-to-HTML**: Do NOT pass any `--theme` parameter when converting markdown to HTML. Use the default theme (no theme argument). **Article Workflow**: 1. Opens `https://card.weibo.com/article/v3/editor` 2. Clicks "写文章" button, waits for editor to become editable 3. Fills title (validated for 32-char limit) 4. Fills summary/导语 (validated for 44-char limit) 5. Inserts HTML content into ProseMirror editor via paste 6. Replaces image placeholders one by one (copy image → select placeholder → paste) **Post-Composition Check**: The script automatically verifies after all images are inserted: - Remaining `WBIMGPH_` placeholders in editor content - Expected vs actual image count If the check fails (warnings in output), alert the user with the specific issues before they publish. --- ## Post Type Selection Unless the user explicitly specifies the post type: - **Markdown file** (`.md`) → **Headline Article** (头条文章) - **Plain text** / text with images → **Regular Post** ## Troubleshooting ### Chrome debug port not ready If a script fails with `Chrome debug port not ready` or `Unable to connect`, kill only the CDP Chrome instances (those 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 ``` **CRITICAL**: Never kill all Chrome processes (`pkill -f "Google Chrome"`). Only kill Chrome instances launched by CDP with the baoyu-skills profile directory. The user may have regular Chrome windows open. **Important**: This should be done automatically -- when encountering this error, kill the CDP Chrome instances and retry the command without asking the user. ## Notes - First run: manual login required (session persists) - All scripts only fill content into the browser, user must review and publish manually - Cross-platform: macOS, Linux, Windows ## Extension Support Custom configurations via EXTEND.md. See **Preferences** section for paths and supported options. ## Dónde encaja - Categoría: [Marketing](https://skillsagentes.com/categorias/marketing.md) — Campañas, copy, lanzamientos, social y ciclos de crecimiento. - Creador: [JimLiu](https://skillsagentes.com/creators/jimliu.md) — 0 skills en el directorio - [Todas las skills](https://skillsagentes.com/skills.md) - [Ranking de instalaciones](https://skillsagentes.com/ranking.md) ## Otras skills del mismo repositorio - [Baoyu Image Gen](https://skillsagentes.com/skills/jimliu/baoyu-skills/baoyu-image-gen.md): Generación de imágenes con IA usando OpenAI GPT Image 2, Azure OpenAI, Google, OpenRouter, DashScope, Z.AI GLM-Image, MiniMax, Jimeng, Seedream, Replicate y Agnes; soporta texto a imagen, referencias, aspectos y lotes. - [Baoyu Post To Wechat](https://skillsagentes.com/skills/jimliu/baoyu-skills/baoyu-post-to-wechat.md): Publica contenido en WeChat Official Account (微信公众号) vía API o Chrome CDP, con posts de artículo (文章) o de imagen-texto (贴图/图文). - [Baoyu Wechat Summary](https://skillsagentes.com/skills/jimliu/baoyu-skills/baoyu-wechat-summary.md): Convierte los chats de un grupo de WeChat en un resumen estructurado usando el binario local wx-cli, con historial, perfiles de usuario y memoria de hechos por grupo entre ejecuciones. - [Baoyu Post To X](https://skillsagentes.com/skills/jimliu/baoyu-skills/baoyu-post-to-x.md): Publica contenido y artículos en X (Twitter): posts normales con imágenes/vídeos y X Articles en Markdown, vía plugin Chrome de Codex, Computer Use o scripts CDP. - [Baoyu Cover Image](https://skillsagentes.com/skills/jimliu/baoyu-skills/baoyu-cover-image.md): Genera portadas de artículos con 5 dimensiones (tipo, paleta, renderizado, texto, mood), combinando 11 paletas y 7 estilos de renderizado, en formatos cinematic, widescreen o square. ## Skills relacionadas - [Baoyu Article Illustrator](https://skillsagentes.com/skills/jimliu/baoyu-skills/baoyu-article-illustrator.md): Analiza la estructura del artículo, identifica dónde faltan apoyos visuales y genera ilustraciones combinando Tipo × Estilo × Paleta. Úsalo para "ilustrar artículo", "añadir imágenes" o "为文章配图". - [Baoyu Danger Gemini Web](https://skillsagentes.com/skills/jimliu/baoyu-skills/baoyu-danger-gemini-web.md): Genera imágenes y texto mediante la API web de Gemini (ingeniería inversa). Soporta generación de texto e imágenes, imágenes de referencia para visión y conversaciones multi-turno. - [Baoyu Electron Extract](https://skillsagentes.com/skills/jimliu/baoyu-skills/baoyu-electron-extract.md): Extrae recursos y JavaScript de cualquier app Electron instalada (app.asar), restaurando las fuentes originales desde .js.map o formateando el código minificado con Prettier. - [Baoyu Format Markdown](https://skillsagentes.com/skills/jimliu/baoyu-skills/baoyu-format-markdown.md): Da formato a textos planos o markdown: añade frontmatter, títulos, resúmenes, encabezados, negritas, listas y bloques de código, guardando el resultado en {filename}-formatted.md. - [Release Skills](https://skillsagentes.com/skills/jimliu/baoyu-skills/release-skills.md): Flujo de release universal: detecta archivos de versión y changelogs, soporta Node.js, Python, Rust, Claude Plugin, GitHub Releases, tags anotados y backfill histórico. --- Skills Agentes · [Índice de páginas en markdown](https://skillsagentes.com/sitemap.md) · [Inicio](https://skillsagentes.com/index.md)