Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Post articles and image-text content to WeChat Official Account via API or Chrome CDP, with markdown-to-WeChat HTML conversion.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/image-text-posting.md
1# Image-Text Posting (贴图发表, formerly 图文)23Post image-text messages with multiple images to WeChat Official Account.45> **Note**: WeChat has renamed "图文" to "贴图" in the Official Account menu (as of 2026).67## Usage89```bash10# Post with images and markdown file (title/content extracted automatically)11${BUN_X} ./scripts/wechat-browser.ts --markdown source.md --images ./images/1213# Post with explicit title and content14${BUN_X} ./scripts/wechat-browser.ts --title "标题" --content "内容" --image img1.png --image img2.png1516# Save as draft17${BUN_X} ./scripts/wechat-browser.ts --markdown source.md --images ./images/ --submit18```1920## Parameters2122| Parameter | Description |23|-----------|-------------|24| `--markdown <path>` | Markdown file for title/content extraction |25| `--images <dir>` | Directory containing images (sorted by name) |26| `--title <text>` | Article title (max 20 chars, auto-compressed if too long) |27| `--content <text>` | Article content (max 1000 chars, auto-compressed if too long) |28| `--image <path>` | Single image file (can be repeated) |29| `--submit` | Save as draft (default: preview only) |30| `--profile <dir>` | Chrome profile directory |3132## Auto Title/Content from Markdown3334When using `--markdown`, the script:35361. **Parses frontmatter** for title and author:37```yaml38---39title: 文章标题40author: 作者名41---42```43442. **Falls back to H1** if no frontmatter title:45```markdown46# 这将成为标题47```48493. **Compresses title** to 20 characters if too long:50- Original: "如何在一天内彻底重塑你的人生"51- Compressed: "一天彻底重塑你的人生"52534. **Extracts first paragraphs** as content (max 1000 chars)5455## Image Directory Mode5657When using `--images <dir>`:5859- All PNG/JPG files in directory are uploaded60- Files are sorted alphabetically by name61- Naming convention: `01-cover.png`, `02-content.png`, etc.6263## Constraints6465| Field | Max Length | Notes |66|-------|------------|-------|67| Title | 20 chars | Auto-compressed if longer |68| Content | 1000 chars | Auto-compressed if longer |69| Images | 9 max | WeChat limit |7071## Example Session7273```74User: /post-to-wechat --markdown ./article.md --images ./xhs-images/7576Claude:771. Parses markdown meta:78- Title: "如何在一天内彻底重塑你的人生" → "一天内重塑你的人生"79- Author: from frontmatter or default802. Extracts content from first paragraphs813. Finds 7 images in xhs-images/824. Opens Chrome, navigates to WeChat "图文" editor835. Uploads all images846. Fills title and content857. Reports: "Image-text posted with 7 images."86```8788## Scripts8990| Script | Purpose |91|--------|---------|92| `wechat-browser.ts` | Main image-text posting script |93| `cdp.ts` | Chrome DevTools Protocol utilities |94| `copy-to-clipboard.ts` | Clipboard operations |95