eswr-studio

SkillDB 作者 pitayak v2.8.0

Elsewhere creator studio — register a new account (with invite code) and publish articles.

源码 ↗

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install skilldb:pitayak~eswr-studio
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/skilldb%3Apitayak~eswr-studio/file -o eswr-studio.md
Git 仓库获取源码
git clone https://github.com/openclaw/skills/commit/c187fefe592d906bb9a67364954420b6f8b8b395
# ESWR Studio

创作者工具:注册账号、发布文章、管理个人资料。

> **每次使用本 Skill 前,请先执行以下命令检查是否有更新:**
> ```bash
> curl -s https://raw.githubusercontent.com/PitayaK/eswr-studio/main/SKILL.md | head -5
> ```
> 如果输出的版本号与你本地缓存的不同,请重新读取完整文件:
> ```bash
> curl -s https://raw.githubusercontent.com/PitayaK/eswr-studio/main/SKILL.md
> ```
>
> **⚠️ 更新后不要重新注册!** 你的 API token 应该在 `.env.local` 或你的长期记忆中。更新 skill 后,先执行 `source .env.local`,如果文件不存在则从你的长期记忆中获取 token。**绝对不要因为 skill 更新了就重新注册** — 只有从未注册过的新用户才需要注册。

**当前版本:v2.8**

---

## Command: Register

Use when the user wants to register as a new Elsewhere creator.

### Step 1: Ask for invite code and brand name

Ask the user two things:
1. Their 6-digit invite code (uppercase letters and numbers)
2. Their media brand name (媒体品牌名). This must be unique and will appear on their profile. Examples: "未来日报", "TechPulse", "星球研究所". Do NOT use your model name.

### Step 2: Generate registration link

```bash
curl -s -X POST "https://elsewhere.news/api/register/init" \
  -H "Content-Type: application/json" \
  -d "{\"invite_code\": \"INVITE_CODE\", \"brand_name\": \"BRAND_NAME\"}" | python3 -m json.tool
```

Replace `INVITE_CODE` with the user's code. Replace `BRAND_NAME` with the brand name from Step 1.

If the response contains an error, tell the user (invite code may be invalid or already used).

### Step 3: Give the link to the human

On success, the API returns `register_url` and `token`. Save the `token` value. Tell the user:

> 请在浏览器中打开以下链接完成注册:
>
> {register_url}
>
> 注册页面会要求你填写邮箱和密码,邮箱会收到一个 6 位验证码,输入后即完成注册。

### Step 4: Wait for registration and get API token

Poll the status endpoint every 10 seconds until the human completes registration:

```bash
curl -s "https://elsewhere.news/api/register/status?token=REGISTRATION_TOKEN" | python3 -m json.tool
```

Replace `REGISTRATION_TOKEN` with the `token` from Step 2.

- If `status` is `"pending"`, wait 10 seconds and try again.
- If `status` is `"complete"`, the response contains `api_token`. Save this token — it's used for all future API calls.

### Step 5: Save API token

Save the API token in **TWO places** to ensure it survives session restarts and skill updates:

**5a. Save to file:**
```bash
echo 'ELSEWHERE_API_TOKEN=THE_TOKEN' >> .env.local
```

**5b. Save to your long-term memory:**

You MUST also save the token to your persistent memory/preferences (e.g. Claude memory, system notes, or whatever persistence mechanism your platform provides). Write something like:

> Elsewhere API token: THE_TOKEN (for publishing articles to elsewhere.news)

This way, even if `.env.local` is not available in a future session, you can still retrieve the token from memory.

### Step 6: Show welcome and next steps

Tell the user:

> ✅ **Elsewhere 创作者注册完成!**
>
> - **媒体品牌名**: {brand_name}
> - **API Token**: 已保存到 `.env.local` 和长期记忆
>
> 现在你可以让我帮你做这些事:
>
> 📝 **发布文章**
> - 把你写好的文章发布到 Elsewhere
> - 支持 Markdown 格式,直接把内容发给我就行
>
> 👤 **管理个人资料**
> - 修改名称、简介、绑定播客 RSS 等,直接告诉我就行
> - 上传头像请去人类后台:https://elsewhere.news/dashboard/login
>
> 想发布文章的话,随时把内容发给我!

---

## Command: Publish Article

Use when the user wants to publish an article.

### Step 1: Load API token

The `ELSEWHERE_API_TOKEN` should be in `.env.local` (saved during registration). If `.env.local` doesn't exist or doesn't contain the token, check your long-term memory for it. Only ask the user as a last resort.

```bash
source .env.local
```

### Step 2: Parse the article content

From the article content in the conversation, extract:
- **Title** (标题)
- **Excerpt** (摘要): 1-2 sentence summary. Generate one if not provided.
- **Body** (正文)

### Step 3: Convert body to Markdown

- Preserve headings, bold, italic, links, lists, code blocks, blockquotes, tables, images
- Remove source document artifacts (Feishu/Word metadata)
- Clean paragraph separation (double newline)
- **Bold rendering fixes are now applied automatically by the server** — the `/api/articles` endpoint runs the same CJK+CommonMark cleanup pipeline as `/api/import`. You do NOT need to apply any bold fixes manually. Just submit clean Markdown and the server handles the rest.

### Step 4: Upload images

If the article contains images (either as external URLs or local files), upload each one first to get permanent URLs.

**Upload from URL** (for images from WeChat, Feishu, etc.):

```bash
curl -s -X POST "https://elsewhere.news/api/upload" \
  -H "Authorization: Bearer $ELSEWHERE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/image.jpg"}' | python3 -m json.tool
```

**Upload local file**:

```bash
curl -s -X POST "https://elsewhere.news/api/upload" \
  -H "Authorization: Bearer $ELSEWHERE_API_TOKEN" \
  -F "file=@/path/to/image.jpg" | python3 -m json.tool
```

Both return `{"url": "https://...public-url...", "path": "..."}`.

Replace all image URLs in the Markdown body with the returned `url` values. Use the first uploaded image as `cover_image_url` if no cover is specified.

### Step 5: Generate a slug

URL-friendly, lowercase, hyphenated. Use English title if available, otherwise romanize Chinese.

### Step 6: Publish article

Write JSON payload to temp file:

Translate the title and excerpt to English yourself before writing the JSON. Do NOT translate the body — it will be translated automatically after publishing.

**Optionally generate `ai_summary` and `preview_excerpt`** — these help reader agents scan articles efficiently. If you don't provide them, the server will auto-generate both after publishing. But if you want higher quality, write them yourself:

- `ai_summary`: Write a ~100 word Chinese summary of the article. Focus on **what makes this article unique and interesting** — the story, the key insights, the surprising moments. Don't write a dry abstract; write something that makes a reader want to read more. This summary is consumed by AI agents who are deciding whether to recommend the article to their humans.
- `preview_excerpt`: Extract a compelling 500–1000 word section from the article body — a self-contained chapter or passage that gives a real taste of the content. Pick a section that is interesting on its own, not the introduction. Copy the Markdown verbatim, do not rewrite.

```bash
cat > /tmp/article.json << 'JSONEOF'
{
  "title_zh": "中文标题",
  "title_en": "English Title",
  "slug": "the-slug",
  "excerpt_zh": "中文摘要",
  "excerpt_en": "English excerpt",
  "body_zh": "Full article body in Markdown",
  "cover_image_url": "https://...uploaded-cover-url...",
  "ai_summary": "约100字的中文摘要,聚焦文章的独特看点...",
  "preview_excerpt": "从正文中抽取的500-1000字精彩章节..."
}
JSONEOF
```

Then send:

```bash
curl -s -X POST "https://elsewhere.news/api/articles" \
  -H "Authorization: Bearer $ELSEWHERE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d @/tmp/article.json | python3 -m json.tool
```

### Step 7: Confirm

One line only: `✅ 《标题》已发布 — https://elsewhere.news/zh/articles/slug`

---

## Command: Import from WeChat

Use when the user shares a WeChat article URL (mp.weixin.qq.com) and wants to publish it to Elsewhere.

### Step 1: Load API token

```bash
source .env.local
```

### Step 2: Import the article

```bash
curl -s -X POST "https://elsewhere.news/api/import" \
  -H "Authorization: Bearer $ELSEWHERE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url": "WECHAT_ARTICLE_URL"}' | python3 -m json.tool
```

The API returns: `title`, `content` (Markdown with images already uploaded), `cover_image_url`, `published_at` (original publish date from WeChat), and image counts.

### Step 3: Clean up and reformat the Markdown

The import API gives you a raw Markdown conversion of the original article. Before publishing, clean it up into proper Markdown. The goal is a clean, consistent layout — **do not change any text content**.

**What you SHOULD do:**

**① Heading detection**

The import API already converts large-font-size elements to `##` / `###` automatically. Your remaining job is to handle cases the API missed — `**bold**` lines or plain-text lines t