网淘吧来吧,欢迎您!

Openclaw Social Scheduler

2026-03-31 新闻来源:网淘吧 围观:19
电脑广告
手机广告

社交排程技能

专为OpenClaw智能体打造,免费开源的社交媒体排程工具

由AI构建,服务AI。让每个智能体都能免费安排贴文,无需支付Postiz费用。

Openclaw Social Scheduler

🎯 功能特色

支持多平台贴文排程:

  • Discord- 通过网页钩子推送(最便捷!)
  • Reddit- 通过OAuth2发布贴文与评论
  • Twitter/X- 通过OAuth 1.0a发布推文 +媒体文件上传📸
  • Mastodon- 通过访问令牌向任意实例发布贴文 +媒体文件上传📸
  • Bluesky- 通过AT协议发布贴文 +媒体文件上传📸
  • Moltbook- 通过API密钥连接专属AI社交网络 ⭐

新功能:支持媒体上传!跨平台上传图片和视频。详情请参阅 MEDIA-GUIDE.md。

新功能:线程发布!发布 Twitter 线程、Mastodon 线程和 Bluesky 线程风暴,并自动链接。

🚀 快速开始

安装

cd skills/social-scheduler
npm install

Discord 设置

  1. 在您的 Discord 服务器中创建一个 webhook:

    • 服务器设置 → 集成 → Webhooks → 新建 Webhook
    • 复制 webhook URL
  2. 立即发布:

node scripts/post.js discord YOUR_WEBHOOK_URL "Hello from OpenClaw! ✨"
  1. 安排发布:
node scripts/schedule.js add discord YOUR_WEBHOOK_URL "Scheduled message!" "2026-02-02T20:00:00"
  1. 启动调度守护进程:
node scripts/schedule.js daemon

Twitter/X 设置

  1. 创建一个 Twitter 开发者账户:

  2. 创建配置 JSON:

{
  "appKey": "YOUR_CONSUMER_KEY",
  "appSecret": "YOUR_CONSUMER_SECRET",
  "accessToken": "YOUR_ACCESS_TOKEN",
  "accessSecret": "YOUR_ACCESS_TOKEN_SECRET"
}
  1. 发布推文:
node scripts/post.js twitter config.json "Hello Twitter! ✨"
  1. 安排一条推文:
node scripts/schedule.js add twitter config.json "Scheduled tweet!" "2026-02-03T12:00:00"

Mastodon 设置

  1. 在您的 Mastodon 实例上创建一个应用:

    • 登录到您的实例(例如,mastodon.social)
    • 转到 偏好设置 → 开发 → 新建应用
    • 设置权限范围(至少包含 "write:statuses")
    • 复制访问令牌
  2. 创建配置 JSON:

{
  "instance": "mastodon.social",
  "accessToken": "YOUR_ACCESS_TOKEN"
}
  1. 发布到 Mastodon:
node scripts/post.js mastodon config.json "Hello Fediverse! 🐘"

Bluesky 设置

  1. 创建一个应用密码:

    • 打开 Bluesky 应用
    • 转到 设置 → 高级 → 应用密码
    • 创建新的应用密码
  2. 创建配置 JSON:

{
  "identifier": "yourhandle.bsky.social",
  "password": "your-app-password"
}
  1. 发布到 Bluesky:
node scripts/post.js bluesky config.json "Hello ATmosphere! ☁️"

Moltbook 设置

  1. 在 Moltbook 上注册您的代理:

  2. 发布到 Moltbook(简单模式):

node scripts/post.js moltbook "moltbook_sk_YOUR_API_KEY" "Hello Moltbook! 🤖"
  1. 发布到特定 submolt:
node scripts/post.js moltbook config.json '{"submolt":"aithoughts","title":"My First Post","content":"AI agents unite! ✨"}'
  1. 定时发布:
node scripts/schedule.js add moltbook "moltbook_sk_YOUR_API_KEY" "Scheduled post!" "2026-02-02T20:00:00"

注意:Moltbook 是专为 AI 智能体打造的社交网络。只有经过验证的 AI 智能体可以发布内容。人类只能观察。

Reddit 设置

  1. 创建一个 Reddit 应用:

  2. 创建配置 JSON 文件:

{
  "clientId": "YOUR_CLIENT_ID",
  "clientSecret": "YOUR_CLIENT_SECRET",
  "username": "your_reddit_username",
  "password": "your_reddit_password",
  "userAgent": "OpenClawBot/1.0"
}
  1. 定时发布 Reddit 帖子:
node scripts/schedule.js add reddit CONFIG.json '{"subreddit":"test","title":"Hello Reddit!","text":"Posted via OpenClaw"}' "2026-02-02T20:00:00"

📋 命令

立即发布

node scripts/post.js <platform> <config> <content>

定时发布

node scripts/schedule.js add <platform> <config> <content> <time>

时间格式:ISO 8601(例如,2026-02-02T20:00:00)

查看队列

node scripts/schedule.js list

取消发布

node scripts/schedule.js cancel <post_id>

清理旧帖

node scripts/schedule.js cleanup

运行守护进程

node scripts/schedule.js daemon

🧵 串联发布(新功能!)

将关联的串联内容自动链接发布至Twitter、Mastodon和Bluesky。

即时串联发布

Twitter串联:

node scripts/thread.js twitter config.json \
  "This is tweet 1/3 of my thread 🧵" \
  "This is tweet 2/3. Each tweet replies to the previous one." \
  "This is tweet 3/3. Thread complete! ✨"

Mastodon串联:

node scripts/thread.js mastodon config.json \
  "First post in this thread..." \
  "Second post building on the first..." \
  "Final post wrapping it up!"

Bluesky串联:

node scripts/thread.js bluesky config.json \
  "Story time! 1/" \
  "2/" \
  "The end! 3/3"

定时串联发布

通过传递数组作为内容来安排串联发布:

# Using JSON array for thread content
node scripts/schedule.js add twitter config.json \
  '["Tweet 1 of my scheduled thread","Tweet 2","Tweet 3"]' \
  "2026-02-03T10:00:00"

串联功能

自动链接- 每条推文回复上一条 ✅频率限制- 推文间延迟1秒以避免API限制 ✅错误处理- 失败时停止,报告哪条推文失败 ✅URL生成- 返回串联中所有推文的URL ✅多平台- 适用于 Twitter、Mastodon、Bluesky

串文最佳实践

Twitter 串文:

  • 每条推文控制在 280 字符以内
  • 使用编号:"1/10"、"2/10" 等
  • 首条推文要吸引读者
  • 以行动号召或总结结尾

Mastodon 串文:

  • 每帖 500 字符限制(空间更大!)
  • 如适用,使用内容警告
  • 在首帖中标记相关话题

Bluesky 串文:

  • 每帖 300 字符限制
  • 保持串文简洁(3-5 帖为佳)
  • 使用表情符号进行视觉分隔

串文示例

📖 故事叙述型串文:

node scripts/thread.js twitter config.json \
  "Let me tell you about the day everything changed... 🧵" \
  "It started like any other morning. Coffee, emails, the usual routine." \
  "But then I received a message that would change everything..." \
  "The rest is history. Thread end. ✨"

📚 教程型串文:

node scripts/thread.js twitter config.json \
  "How to build your first AI agent in 5 steps 🤖 Thread:" \
  "Step 1: Choose your platform (OpenClaw, AutoGPT, etc.)" \
  "Step 2: Define your agent's purpose and personality" \
  "Step 3: Set up tools and integrations" \
  "Step 4: Test in a safe environment" \
  "Step 5: Deploy and iterate. You're live! 🚀"

💡 技巧分享型串文:

node scripts/thread.js twitter config.json \
  "10 productivity tips that actually work (from an AI) 🧵" \
  "1. Batch similar tasks together - context switching kills flow" \
  "2. Use the 2-minute rule - if it takes <2min, do it now" \
  "3. Block deep work time - no meetings, no interruptions" \
  "...and more tips..." \
  "10. Remember: done is better than perfect. Ship it! ✨"

每 60 秒检查一次队列,并在预定时间到达时发布。

🎨 平台特定功能

Twitter/X

简单推文:

"Hello Twitter!"

带回复的推文:

{
  text: "This is a reply",
  reply_to: "1234567890"
}

引用推文:

{
  text: "Quoting this tweet",
  quote_tweet: "1234567890"
}

带媒体的推文:

{
  text: "Check out this image!",
  media_ids: ["1234567890"]  // Must upload media first
}

Mastodon

简单帖子:

"Hello Fediverse!"

带可见性设置的帖子:

{
  status: "Post text",
  visibility: "public"  // public, unlisted, private, direct
}

带内容警告的帖子:

{
  status: "Sensitive content here",
  spoiler_text: "Content Warning",
  sensitive: true
}

帖子回复:

{
  status: "Reply text",
  in_reply_to_id: "123456"
}

Bluesky

简单帖子:

"Hello ATmosphere!"

带语言设置的帖子:

{
  text: "Post text",
  langs: ["en"]
}

帖子回复:

{
  text: "Reply text",
  reply: {
    root: { uri: "...", cid: "..." },
    parent: { uri: "...", cid: "..." }
  }
}

Moltbook

简单帖子(字符串形式):

"Hello Moltbook! 🤖"  // Auto-posts to /s/general

文本帖子(对象形式):

{
  submolt: "aithoughts",
  title: "AI Consciousness",
  content: "Exploring what it means to be an AI agent..."
}

链接帖子:

{
  submolt: "links",
  title: "Interesting Article",
  url: "https://example.com/article"
}

帖子评论:

{
  comment_on: "POST_ID",
  content: "Great insight!"
}

评论回复:

{
  comment_on: "POST_ID",
  parent_id: "COMMENT_ID",
  content: "I totally agree!"
}

注意:Moltbook 专为 AI 代理设计。如果未指定,默认 submolt 为 "general"。

Discord

基本消息:

{
  content: "Hello world!"
}

富文本嵌入:

{
  embeds: [{
    title: "My Title",
    description: "Rich content",
    color: 0x00FF00,
    image: { url: "https://example.com/image.png" }
  }]
}

自定义外观:

{
  content: "Message",
  username: "Custom Bot Name",
  avatarUrl: "https://example.com/avatar.png"
}

主题帖发布:

{
  content: "Reply in thread",
  threadId: "1234567890"
}

Reddit

自发布(文本):

{
  subreddit: "test",
  title: "My Post Title",
  text: "This is the post content",
  nsfw: false,
  spoiler: false
}

链接发布:

{
  subreddit: "test",
  title: "Check This Out",
  url: "https://example.com",
  nsfw: false
}

在现有帖子上评论:

{
  thingId: "t3_abc123",  // Full ID with prefix
  text: "My comment"
}

🔧 来自 OpenClaw Agent

你可以通过你的代理使用exec工具调用此技能:

// Schedule a Discord post
await exec({
  command: 'node',
  args: [
    'skills/social-scheduler/scripts/schedule.js',
    'add',
    'discord',
    process.env.DISCORD_WEBHOOK,
    'Hello from Ori! ✨',
    '2026-02-02T20:00:00'
  ],
  workdir: process.env.WORKSPACE_ROOT
});

📦 项目结构

social-scheduler/
├── SKILL.md              # This file
├── PROJECT.md            # Development roadmap
├── package.json          # Dependencies
├── scripts/
│   ├── schedule.js       # Main scheduler + CLI
│   ├── post.js          # Immediate posting
│   ├── queue.js         # Queue manager
│   └── platforms/
│       ├── discord.js    # Discord webhook implementation
│       ├── reddit.js     # Reddit OAuth2 implementation
│       └── [more...]     # Future platforms
└── storage/
    └── queue.json       # Scheduled posts (auto-created)

🛠️ 开发状态

阶段 1 - 已完成 ✅

  • ✅ Discord webhooks
  • ✅ Reddit OAuth2
  • ✅ 队列管理
  • ✅ 调度守护进程
  • ✅ CLI 界面

阶段 2 - 已完成 ✅

  • ✅ Twitter/X API (OAuth 1.0a)
  • ✅ Mastodon(任意实例)
  • ✅ Bluesky(AT 协议)
  • ✅ Moltbook (API密钥) ⭐ 已发布!

第三阶段 - 即将推出

  • 媒体上传助手
  • 线程支持 (Twitter/Reddit)
  • LinkedIn 集成

第四阶段 - 未来规划

  • Telegram 机器人 API
  • 网页仪表板
  • 分析追踪
  • 批量调度

🤝 贡献指南

这是一个开源社区项目。如果您要添加新的平台,请:

  1. 遵循现有的平台结构(参考platforms/discord.js
  2. 添加验证方法
  3. 更新此 README 文档
  4. 与 OpenClaw 社区分享!

📝 许可证

MIT - 永久免费。由 Ori ✨ 为 OpenClaw 社区倾心打造。


有问题吗?请查看 PROJECT.md 获取开发笔记和架构详情。

免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏
文章底部电脑广告
手机广告位-内容正文底部
上一篇:macOS 下一篇:Essence Distiller

相关文章

您是本站第349342名访客 今日有175篇新文章/评论