Skill: utopiabenben/omnipublisher (version 1.0.0)

--- name: omnipublisher description: Omni 内容发布器：一篇文章适配公众号/小红书/知乎/抖音，批量生成多平台版本 metadata: { "openclaw": { "emoji": "🔄", "requires": { "python": "3.7+" }, }, } --- # omnipublisher - 多平台内容发布器 一次写作，到处发布。自动将同一文章转换成不同平台的格式。 ## 平台支持 - 公众号（wechat） - 小红书（xiaohongshu） - 知乎（zhihu） - 抖音（douyin） ## 使用 ```bash omnipublisher article.md --platforms wechat,xiaohongshu ``` 输出： - `article_wechat.md` - `article_xiaohongshu.md` - ... 详细文档见完整版（集成到 social-publisher 或独立文档）。 ## 特点 - 纯 Python，无依赖 - 毫秒级转换 - 自动适配格式和风格 MIT 许可证.

path: install.sh
content: #!/bin/bash
# omnipublisher 安装脚本

set -e
echo "🔄 正在安装 omnipublisher..."
if ! command -v python3 &> /dev/null; then echo "❌ 需要 Python 3.7+"; exit 1; fi
echo "✅ 安装完成！"
echo "使用：omnipublisher article.md --platforms wechat,xiaohongshu"
echo "文档：cat SKILL.md"


path: source/omnipublisher.py
content: #!/usr/bin/env python3
import argparse, json, os, sys
from pathlib import Path

def load_article(filepath):
    with open(filepath, 'r', encoding='utf-8') as f:
        return f.read()

def format_wechat(text):
    lines = []
    for p in text.split('\n\n'):
        p = p.strip()
        if p.startswith('#'):
            lines.append(p)
        else:
            line, words = "", list(p)
            for w in words:
                if len(line.encode('utf-8')) > 60:
                    lines.append(line)
                    line = w
                else:
                    line += w
            if line: lines.append(line)
        lines.append("")
    return "\n".join(lines)

def format_xiaohongshu(text):
    lines = ["✨ 精彩内容 ✨", ""]
    for p in text.split('\n\n')[:5]:
        p = p.strip()
        if not p.startswith('#'):
            lines.append(p[:200] + ("..." if len(p) > 200 else ""))
            lines.append("")
    lines.append("#干货 #分享 #笔记")
    return "\n".join(lines)

def format_zhihu(text):
    lines = []
    for p in text.split('\n\n'):
        p = p.strip()
        if p.startswith('#'):
            lines.append(p)
        else:
            if len(p) > 100 and "。" in p:
                s = p.split("。")[0] + "。"
                if len(s) > 20:
                    p = f"**{s[:20]}**{s[20:]}{p[len(s):]}"
            lines.append(p)
        lines.append("")
    return "\n".join(lines)

def format_douyin(text):
    lines = ["🔥 精彩 🔥", ""]
    for i, p in enumerate([p.strip() for p in text.split('\n\n') if not p.startswith('#')][:3], 1):
        lines.append(f"{i}. {p[:50]}")
        lines.append("")
    lines.append("👇 关注获取更多！")
    lines.append("#干货 #分享")
    return "\n".join(lines)

def main():
    p = argparse.ArgumentParser(description="OmniPublisher - 一键多平台内容适配")
    p.add_argument("input", help="文章文件")
    p.add_argument("--platforms", default="wechat,xiaohongshu,zhihu,douyin")
    p.add_argument("--output-dir", default=".")
    args = p.parse_args()

    if not os.path.exists(args.input):
        print(f"❌ 不存在: {args.input}")
        sys.exit(1)

    platforms = [x.strip() for x in args.platforms.split(",")]
    article = load_article(args.input)
    outdir = Path(args.output_dir)
    outdir.mkdir(exist_ok=True)
    stem = Path(args.input).stem

    for platform in platforms:
        outpath = outdir / f"{stem}_{platform}.md"
        try:
            if platform == "wechat":
                content = format_wechat(article)
            elif platform == "xiaohongshu":
                content = format_xiaohongshu(article)
            elif platform == "zhihu":
                content = format_zhihu(article)
            elif platform == "douyin":
                content = format_douyin(article)
            else:
                continue
            with open(outpath, 'w', encoding='utf-8') as f:
                f.write(content)
            print(f"✅ {platform}: {outpath}")
        except Exception as e:
            print(f"❌ {platform} 失败: {e}")

    print("\n🎉 完成！")

if __name__ == "__main__":
    main()


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)