threads-publish

star 8.3k

Publish posts to Threads via Meta Graph API. Supports text, image, video, and carousel posts. Requires Meta OAuth2 token with threads_basic and threads_content_publish permissions.

TeamWiseFlow By TeamWiseFlow schedule Updated 6/4/2026

name: threads-publish description: Publish posts to Threads via Meta Graph API. Supports text, image, video, and carousel posts. Requires Meta OAuth2 token with threads_basic and threads_content_publish permissions. metadata: openclaw: emoji: 🧵 requires: bins: - python3


Threads 发布(threads-publish)

通过 Meta Graph API 发布内容到 Threads,支持文字、图片、视频和轮播帖子。使用 Content Container 模式。


前置条件

  1. Meta Developer 应用,获取 threads_basic + threads_content_publish 权限
  2. Threads 账户关联到应用
  3. 长效 Token

配置

保存到 ~/.openclaw/credentials/threads_config.json

{
  "access_token": "your_long_lived_token",
  "threads_user_id": "your_threads_user_id"
}

使用方式

文字帖:

python3 ./skills/threads-publish/scripts/publish_threads.py \
  --text "帖子内容 #hashtag"

图片帖:

python3 ./skills/threads-publish/scripts/publish_threads.py \
  --text "描述" \
  --images https://example.com/image.jpg

视频帖:

python3 ./skills/threads-publish/scripts/publish_threads.py \
  --text "描述" \
  --video https://example.com/video.mp4

参数说明

参数 必填 说明
--text 帖子文本内容
--images 图片 URL(逗号分隔,最多 10 张)
--video 视频 URL

错误处理

错误 原因 处理
AUTH_REQUIRED Token 失效 更新 Token
UPLOAD_FAILED 容器创建失败 检查 URL 可访问性
MEDIA_PROCESSING 媒体处理中 轮询状态等待

注意:Threads API 同 Instagram,仅支持 URL 形式的媒体。


发布记录(强制)

发布成功后,必须立即调用 published-track 技能记录发布信息:

./skills/published-track/scripts/record.sh \
  --platform threads \
  --title "标题" \
  --content-type post \
  --source-folder "<原始文件夹路径>" \
  --publish-url "<发布URL>" \
  --publish-date "$(date +%Y-%m-%d)"

--source-folder 为原始内容所在的相对路径(如 output_articles/xxxoutput_videos/xxx)。 --publish-url 为发布后获得的 URL,若发布失败则留空并在 --notes 中注明原因。

执行 ./skills/published-track/scripts/init-db.sh(幂等,重复执行无副作用)。

Install via CLI
npx skills add https://github.com/TeamWiseFlow/wiseflow --skill threads-publish
Repository Details
star Stars 8,256
call_split Forks 1,413
navigation Branch main
article Path SKILL.md
More from Creator
TeamWiseFlow
TeamWiseFlow Explore all skills →