publishing-to-cnblogslisted
Install: claude install-skill babyGao/agent-pilot-skills
# Publishing to 博客园 (cnblogs)
## Overview
Reliably publish a Markdown article to 博客园, or cross-post one from another platform (51cto, etc.). The browser is used only to **log in and (optionally) scrape**; the actual publish goes through cnblogs' own **REST API**, which is far more robust than driving the editor with selenium `send_keys`.
**Core principle:** Re-host every image on cnblogs' own CDN, and publish via the API with `isMarkdown: true`. Hotlinked source images break (anti-leech) and the 2024-era `send_keys` tool rots as the editor DOM changes.
## When to Use
- Cross-posting an already-published article (e.g. on 51cto) to 博客园
- Publishing a local `.md` (with front matter) to 博客园
- Symptoms: images on the published post show **只有链接/裂图**, markdown renders as raw text, or a browser-automation publisher fails on missing selectors
**Not for:** other platforms (CSDN/掘金/知乎…). This skill is cnblogs-specific.
## One-Time Setup
1. **Install deps:** `pip install selenium requests markdownify pyyaml` (Chrome required; selenium>=4.6 auto-fetches the matching chromedriver — else set `CHROMEDRIVER` env var).
2. **Launch an isolated debug Chrome** (coexists with the user's normal Chrome — own profile, no need to close anything):
```bash
chrome --remote-debugging-port=9222 --user-data-dir=/tmp/cnblogs-debug --no-first-run
```
(Windows: `"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir=%TEMP%\cnblogs-debug`)
3. **A