用 OpenClaw 搭建自媒体自动化工作流(完整实战)

0 阅读2分钟
# 用 OpenClaw 搭建自媒体自动化工作流(完整实战)


## 背景

我是一个公众号博主,用 OpenClaw 创业。

之前写一篇文章的流程:

找素材(1 小时)→ 写大纲(30 分钟)→ 写初稿(2 小时)→ 修改排版(30 分钟)→ 发布(10 分钟)

合计:4 小时 10 分钟

现在:

AI 抓取素材(自动)→ AI 写初稿(10 分钟)→ 我审核(20 分钟)→ AI 排版(自动)→ 我发布(5 分钟)

合计:25 分钟

效率提升 10 倍。

## 环境准备

### 1. 安装 OpenClaw

```bash
npm install -g openclaw
openclaw --version

2. 配置技能

openclaw skill install news-aggregator-skill
openclaw skill install wechat-publisher
openclaw skill install feishu-doc

核心代码实现

1. 早间推送(定时任务)

#!/bin/bash
python3 fetch_news.py --source all --limit 80 > news.json
python3 filter_news.py news.json > filtered.json
python3 generate_message.py filtered.json > message.txt
openclaw message send --channel feishu --target "用户 ID" --message "$(cat message.txt)"

配置 cron:

0 7 * * * /root/.openclaw/workspace/scripts/morning-brief.sh

2. 文章生成(事件触发)

#!/usr/bin/env python3
from openclaw import Agent

def generate_article(news_id: int):
    agent = Agent()
    prompt = """
根据以下新闻写一篇公众号文章:
- 短句为主,一句话不超过 20 字
- 口语化,接地气
- 数据驱动
- 结构:痛点 → 案例 → 方法论 → 行动建议
"""
    article = agent.chat(prompt)
    with open(f'drafts/article_{news_id}.md', 'w') as f:
        f.write(article)

3. 多平台分发

from openclaw import Agent

def rewrite_for_platform(article: str, platform: str) -> str:
    agent = Agent()
    prompts = {
        'zhihu': '改写成知乎回答,开头加"谢邀"',
        'xiaohongshu': '改写成小红书笔记,标题加 emoji',
        'juejin': '改写成掘金技术文章,加代码示例'
    }
    return agent.chat(f"{prompts[platform]}\n\n原文:\n{article}")

效果对比

环节之前现在提升
素材收集1 小时自动100%
文章创作2.5 小时20 分钟87%
多平台分发2 小时5 分钟96%
合计6 小时25 分钟93%

总结

用 OpenClaw 搭建自媒体自动化工作流,核心是:

  1. 拆流程 - 把每个环节拆清楚
  2. 选工具 - 选对 AI 工具
  3. 配自动化 - 定时任务 + 事件触发
  4. 持续优化 - 根据数据迭代

效率提升 10 倍不是梦。

别等了,开始干。


作者:小鱼儿 公众号:小鱼儿 AI 创业 知识星球:OpenClaw 实战营(前 10 名免费)


---

📊 发布状态

平台状态操作
公众号✅ 已发布草稿箱后台审核发布
知乎⏸️ 待发布首页搜索问题 → 复制内容 → 发布
小红书⏸️ 待发布上传 5 张图 → 复制内容 → 发布
掘金⏸️ 待发布复制内容 → 粘贴 → 发布