使用此 skill 可以自动发布微头条到今日头条平台。
```bash
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
```
```bash
pip3 install playwright --break-system-packages
playwright install chromium
```
cd ~/.openclaw/workspace/skills/toutiao-publisher/scripts
python3 toutiao_publish.py "要发布的文字内容"
# 单个话题
python3 toutiao_publish.py "内容文字" --topic "#AI#"
# 多个话题
python3 toutiao_publish.py "内容文字" --topic "#AI#,#OpenClaw#,#科技#"
python3 toutiao_publish.py "内容" --image /path/to/image.jpg
python3 toutiao_publish.py -f content.txt
| 参数 | 说明 | 示例 |
|---|---|---|
| ------ | ------ | ------ |
| content | 发布内容 | "今天天气很好" |
| -f, --file | 从文件读取 | -f post.txt |
| -i, --image | 图片路径 | --image pic.jpg |
| -t, --topic | 话题标签,多个用逗号分隔 | --topic "#AI#,#OpenClaw#" |
| --headless | 无头模式 | --headless |
| --no-wait | 不等待登录 | --no-wait |
话题必须使用 双 # 格式:
#AI#、#OpenClaw#、#科技前沿##AI、AI#多个话题用逗号分隔,脚本会自动用空格连接。
~/Desktop/toutiao_publish_success.png~/Desktop/toutiao_error.png| 问题 | 解决方案 |
|---|---|
| ------ | ---------- |
| 无法连接 Chrome | 确保 Chrome 已启动并开启 9222 端口 |
| 未检测到登录 | 在 Chrome 中访问 mp.toutiao.com 完成登录 |
| 发布失败 | 检查网络连接,查看错误截图 |
共 1 个版本