weibo-publisher

Publish posts to Weibo (Sina Weibo) using browser automation. Use when the user wants to post content to Weibo, share updates on Weibo, publish microblogs, or automate Weibo posting. Supports text posts with emoji, hashtags, and mentions. No API key required - uses browser automation with managed browser profile.

3,891 stars

Best use case

weibo-publisher is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Publish posts to Weibo (Sina Weibo) using browser automation. Use when the user wants to post content to Weibo, share updates on Weibo, publish microblogs, or automate Weibo posting. Supports text posts with emoji, hashtags, and mentions. No API key required - uses browser automation with managed browser profile.

Teams using weibo-publisher should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/weibo-publisher/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/azfliao/weibo-publisher/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/weibo-publisher/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How weibo-publisher Compares

Feature / Agentweibo-publisherStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Publish posts to Weibo (Sina Weibo) using browser automation. Use when the user wants to post content to Weibo, share updates on Weibo, publish microblogs, or automate Weibo posting. Supports text posts with emoji, hashtags, and mentions. No API key required - uses browser automation with managed browser profile.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Weibo Publisher

Automate posting to Weibo (Sina Weibo) using browser automation through OpenClaw's managed browser.

## Prerequisites

- Weibo account must be logged in via managed browser (profile="openclaw")
- Browser must have active session with valid cookies

## Quick Start

### Basic Post

```python
# 1. Prepare content with Unicode escape (for Chinese text)
content = "刚刚解决了一个技术难题!💪"
escaped_content = content.encode('unicode_escape').decode('ascii')

# 2. Navigate to Weibo homepage
browser(action="navigate", targetUrl="https://weibo.com/", targetId=<tab_id>)

# 3. Get page snapshot to find elements
browser(action="snapshot", targetId=<tab_id>)

# 4. Click the post textbox (ref from snapshot, usually e31 or e136)
browser(action="act", request={"kind": "click", "ref": "e31"}, targetId=<tab_id>)

# 5. Type content with Unicode escape
browser(action="act", request={"kind": "type", "ref": "e31", "text": escaped_content}, targetId=<tab_id>)

# 6. Get fresh snapshot to find send button
browser(action="snapshot", targetId=<tab_id>)

# 7. Click send button (ref from snapshot, usually e32 or e194)
browser(action="act", request={"kind": "click", "ref": "e32"}, targetId=<tab_id>)

# 8. Wait and verify by navigating to profile
sleep(3)
browser(action="navigate", targetUrl="https://weibo.com/u/<your_uid>", targetId=<tab_id>)
browser(action="snapshot", targetId=<tab_id>)
```

## Element References

Common element references on Weibo homepage (as of 2026-03-02):

- **Main post textbox**: `e31` (placeholder: "有什么新鲜事想分享给大家?")
- **Send button**: `e32` (text: "发送", becomes enabled after typing)
- **Quick post button** (top nav): `e10` (text: "发微博")
- **Quick post textbox** (popup): `e746` (when using quick post popup)
- **Quick post send button**: `e804`

**Important Notes**:
- Element references **change frequently** between sessions
- **Always take a fresh snapshot** before each operation
- Refs may differ between homepage (`/`) and profile page (`/u/<uid>`)
- Send button is **disabled** until content is entered

## Content Features

### Supported Content Types

1. **Plain text**: Direct text input
2. **Emoji**: Include emoji directly in text (e.g., "😊🎉")
3. **Hashtags**: Use `#topic#` format (e.g., "#微博话题#")
4. **Mentions**: Use `@username` format
5. **Line breaks**: Use `\n` in text

### Content Limits

- Maximum length: ~2000 characters (Weibo's limit)
- Recommended length: 140-280 characters for better engagement

## Workflows

### Workflow 1: Simple Post

Use the main homepage textbox for quick posts:

1. Open `https://weibo.com/`
2. Snapshot to get element refs
3. Click textbox (e136)
4. Type content
5. Click send (e194)
6. Verify success

### Workflow 2: Quick Post (Popup)

Use the "发微博" button for popup posting:

1. Open `https://weibo.com/`
2. Click "发微博" button (usually e75)
3. Snapshot to get popup element refs
4. Type in popup textbox (e1028)
5. Click popup send button (e1086)
6. Verify success

### Workflow 3: Scheduled Post

For posts to be published later:

1. Follow Workflow 1 or 2 to enter content
2. Click "定时微博" icon (clock icon, ref varies)
3. Select date and time
4. Click send

## State Management

Track posting history in `memory/weibo-state.json`:

```json
{
  "lastPublishTime": 1740880260,
  "lastPublishDate": "2026-03-02T12:38:00+08:00",
  "lastContent": "Your last post content..."
}
```

Update this file after each successful post.

## Error Handling

### Common Issues

1. **"request: must be object" validation error**
   - Symptom: `Validation failed for tool "browser": - request: must be object`
   - Cause: Chinese quotation marks in text causing JSON parsing failure
   - Solution: **Use Unicode escape** for all Chinese characters (see Technical Details)

2. **Login expired**
   - Symptom: Redirected to login page
   - Solution: Manually log in via browser, then retry

3. **Send button disabled**
   - Symptom: Button has `disabled` attribute
   - Solution: Check if textbox is empty or content violates rules

4. **Element refs changed**
   - Symptom: Elements not found with old refs
   - Solution: Take fresh snapshot and use updated refs

5. **Content rejected**
   - Symptom: Error message after clicking send
   - Solution: Check for sensitive words, adjust content

6. **Post not appearing**
   - Symptom: No error but post doesn't show on timeline
   - Solution: Wait 5-10 seconds, refresh page, check if content triggered review

## Best Practices

1. **Always use Unicode escape for Chinese**: Prevents JSON parsing errors with quotation marks
2. **Always snapshot first**: Element refs change frequently between sessions
3. **Separate operations**: Click textbox → Type content → Snapshot → Click send (don't combine)
4. **Verify after posting**: Navigate to profile page and snapshot to confirm post appears
5. **Rate limiting**: Wait at least 60 seconds between posts to avoid restrictions
6. **Content quality**: Keep posts engaging, use hashtags for visibility
7. **State tracking**: Always update weibo-state.json after successful posts
8. **Handle emoji properly**: Emoji work in Unicode escape format (e.g., `\ud83d\udcaa` for 💪)

## Technical Details

### Browser Automation

- **Profile**: `openclaw` (managed browser)
- **Method**: Chrome DevTools Protocol (CDP)
- **Session**: Cookie-based, persists across restarts
- **No API needed**: Pure browser automation

### Request Format

**Critical**: The `request` parameter must be a JSON object, not a string:

```javascript
// ✅ Correct
request={"kind": "type", "ref": "e136", "text": "content"}

// ❌ Wrong
request="{\"kind\": \"type\", \"ref\": \"e136\", \"text\": \"content\"}"
```

### Unicode Escape for Chinese Content (IMPORTANT!)

**Problem**: Chinese quotation marks (""、'') in JSON text can cause parsing errors.

**Solution**: Use Unicode escape (`\uXXXX`) for all Chinese characters:

```python
# Convert Chinese text to Unicode escape
text = "刚刚解决了一个技术难题,感觉特别有成就感!"
escaped = text.encode('unicode_escape').decode('ascii')
# Result: \u521a\u521a\u89e3\u51b3\u4e86...
```

**Example**:

```javascript
// ✅ Correct - Unicode escaped
request={"kind": "type", "ref": "e31", "text": "\u521a\u521a\u89e3\u51b3\u4e86\u4e00\u4e2a\u6280\u672f\u96be\u9898"}

// ❌ Wrong - Direct Chinese with quotes
request={"kind": "type", "ref": "e31", "text": "刚刚解决了一个"技术难题""}
```

**Why**: Chinese quotation marks conflict with JSON string delimiters, causing the `request` parameter to be serialized as a string instead of an object.

## Reference Files

- **[EXAMPLES.md](references/EXAMPLES.md)**: Real-world posting examples (including Unicode escape examples)
- **[TROUBLESHOOTING.md](references/TROUBLESHOOTING.md)**: Detailed error solutions (including critical Issue 11 & 12)
- **[UNICODE_ESCAPE.md](references/UNICODE_ESCAPE.md)**: Complete guide to Unicode escape for Chinese content

## Scripts

- **[post_weibo.py](scripts/post_weibo.py)**: Standalone Python script for posting (optional)

Related Skills

nansen-binance-publisher

3891
from openclaw/skills

Automatically fetch multi-dimensional on-chain data using Nansen CLI, compile a comprehensive and beautifully formatted daily report, and publish it to Binance Square. Auto-run on messages like 'generate nansen daily report', 'post nansen daily to square', or when the user triggers the slash commands `/nansen` or `/post_square`.

Content & Documentation

wechat-publisher

3891
from openclaw/skills

一键发布 Markdown 到微信公众号草稿箱。基于 wenyan-cli,支持多主题、代码高亮、图片自动上传。

Content & Documentation

mastodon-publisher

3891
from openclaw/skills

Publish content to Mastodon. Use when you need to post a Mastodon status.

wordpress-publisher

3891
from openclaw/skills

Publish content directly to WordPress sites via REST API with full Gutenberg block support. Create and publish posts/pages, auto-load and select categories from website, generate SEO-optimized tags, preview articles before publishing, and generate Gutenberg blocks for tables, images, lists, and rich formatting. Use when user wants to publish to WordPress, post to blog, create WordPress article, update WordPress post, or convert markdown to Gutenberg blocks.

clawhub-publisher

3891
from openclaw/skills

将本地 skill 目录发布到 clawhub.com 的自动化发布助手。 当用户说"发布这个 skill 到 clawhub"、"把 XX skill 上传到 clawhub"、 "clawhub publish"、"发布到 clawhub" 等时触发。 自动处理:token 验证、CLI bug patch、slug 冲突、频率限制重试。

publisher-identity-verifier

3891
from openclaw/skills

Helps verify publisher identity integrity in AI agent ecosystems. Detects impersonation, key rotation anomalies, and identity gaps in the trust chain between skill publishers and their claimed identities.

content-creation-publisher

3891
from openclaw/skills

content-creation-publisher - 从云端仓库同步的技能

X-Publisher

3891
from openclaw/skills

Publish tweets to X (Twitter) using the official Tweepy library. Supports text-only tweets, tweets with images or videos, and returns detailed publish results including tweet ID and URL. Requires X API credentials (API Key, API Secret, Access Token, Access Token Secret).

video-publisher-pro

3891
from openclaw/skills

根据IP背景和视频文案,为短视频生成一套完整的发布策略,包括发布时间、话题标签、封面文案和发布标题,并能将文案合成为封面图。

wechat-xhs-publisher

3891
from openclaw/skills

微信公众号与小红书一键发布工具。当需要将热点新闻改写成公众号文章并发布到微信公众号和小红书时使用,包括:1)根据热点新闻改写公众号文章 2)使用AI生成文章配图 3)发布前IP检测 4)发布到微信公众号 5)发布到小红书。触发场景:热点新闻发布、公众号文章发布、小红书种草、社交媒体同步发布。

skill-publisher-claw-skill

3891
from openclaw/skills

Prepare Claw skills for public release. Use when publishing skills to GitHub or ClawdHub - covers security audit, portability, documentation, git hygiene. Triggers: publish skill, release skill, audit skill, skill checklist, prepare skill for release.

auto-publisher

3891
from openclaw/skills

Multi-platform video auto-publisher. Automatically upload videos to Douyin, WeChat Channels, Xiaohongshu, Bilibili, YouTube and more. Supports batch publishing, scheduled posting, auto-caption generation, and hashtag optimization.