home / skills / questnova502 / claude-skills-sync / post-to-weibo

post-to-weibo skill

/skills/post-to-weibo

This skill helps you post text and images to Weibo using a real browser, bypassing anti-bot defenses for reliable updates.

npx playbooks add skill questnova502/claude-skills-sync --skill post-to-weibo

Review the files below or copy the command above to add this skill to your agents.

Files (4)
SKILL.md
2.4 KB
---
name: liubin-post-to-weibo
description: Post content to Weibo (微博). Supports text posts with images. Uses real Chrome with CDP to bypass anti-automation.
---

# Post to Weibo (发微博)

Post content and images to Weibo using 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 `SKILL_DIR`
2. Script path = `${SKILL_DIR}/scripts/<script-name>.ts`
3. Replace all `${SKILL_DIR}` in this document with the actual path

**Script Reference**:
| Script | Purpose |
|--------|---------|
| `scripts/weibo-browser.ts` | Regular posts (text + images) |
| `scripts/copy-to-clipboard.ts` | Copy content to clipboard |
| `scripts/paste-from-clipboard.ts` | Send real paste keystroke |

## Prerequisites

- Google Chrome or Chromium installed
- `bun` installed (for running scripts)
- First run: log in to Weibo in the opened browser window

---

## Regular Posts

Text + up to 9 images.

```bash
# Preview mode (doesn't post)
npx -y bun ${SKILL_DIR}/scripts/weibo-browser.ts "Hello from Claude!"

# With images
npx -y bun ${SKILL_DIR}/scripts/weibo-browser.ts "Check this out!" --image ./photo.png

# Multiple images (max 9)
npx -y bun ${SKILL_DIR}/scripts/weibo-browser.ts "Photos" --image a.png --image b.png --image c.png

# Actually post
npx -y bun ${SKILL_DIR}/scripts/weibo-browser.ts "发布微博!" --image ./photo.png --submit
```

> **Note**: `${SKILL_DIR}` represents this skill's installation directory. Agent replaces with actual path at runtime.

**Parameters**:
| Parameter | Description |
|-----------|-------------|
| `<text>` | Post content (positional argument) |
| `--image <path>` | Image file path (can be repeated, max 9) |
| `--submit` | Actually post (default: preview only) |
| `--profile <dir>` | Custom Chrome profile directory |

---

## Notes

- First run requires manual login (session is saved)
- Always preview before using `--submit`
- Browser closes automatically after operation
- Supports macOS, Linux, and Windows
- Weibo has a 2000 character limit for regular posts

## Extension Support

Custom configurations via EXTEND.md.

**Check paths** (priority order):
1. `.liubin-skills/liubin-post-to-weibo/EXTEND.md` (project)
2. `~/.liubin-skills/liubin-post-to-weibo/EXTEND.md` (user)

If found, load before workflow. Extension content overrides defaults.

Overview

This skill posts text and images to Weibo using a real Chrome browser instance to bypass anti-automation measures. It supports text posts with up to nine images, preview mode, and an explicit submit flag to publish. The tool runs scripts via bun and preserves login sessions after the first manual sign-in. It works on macOS, Linux, and Windows.

How this skill works

The skill launches a real Chrome/Chromium instance controlled through Chrome DevTools Protocol (CDP) to interact with Weibo like a human browser. Scripts live in the scripts/ directory and handle composing posts, uploading images, and optionally submitting the post. On first run you sign in manually; the session is saved so subsequent runs reuse the logged-in profile. There is a preview mode by default; use the --submit flag to actually publish.

When to use it

  • Automating regular Weibo posts that include text and images.
  • Publishing multiple images (up to nine) with one post.
  • Integrating Weibo posting into a local automation or content pipeline.
  • Testing post composition without publishing using preview mode.
  • Using a real browser session to avoid anti-bot detection.

Best practices

  • Run the first script interactively to complete the manual login and save the session.
  • Always use preview mode for verification, then rerun with --submit to publish.
  • Keep image files local and verify paths before running the script.
  • Limit images to nine per post and respect Weibo's 2000 character limit for text.
  • Use --profile to isolate or reuse specific Chrome profiles when needed.

Example use cases

  • Post a short announcement with one image from a local script: npx -y bun scripts/weibo-browser.ts "Announcement" --image ./img.png
  • Prepare a multi-photo update in preview mode before publishing: run without --submit to inspect the draft.
  • Automate daily content updates by invoking the script from a cron job that passes text and image paths.
  • Share event photos by supplying multiple --image flags (max 9) and then run with --submit.
  • Use a custom Chrome profile directory with --profile to keep sessions and cookies separate.

FAQ

Do I need to log in every time?

No. You must sign in manually on first run; the session is saved and reused for subsequent runs.

How do I actually publish instead of preview?

Include the --submit flag when running the script to perform the real post; otherwise it runs in preview mode.