Community写作与编辑github.com

publora/x-post

用于通过 Publora 在 X(Twitter)上发布或安排帖子,包括超过 280 个字符时的自动拆分为线程,最多 4 张图片,或最长 140 秒的视频。需要付费的 Publora 计划。不适用于 Threads 或 Bluesky(每个都有独立的技能)。

x-post 是什么?

该技能使 AI 代理能够通过 Publora MCP 服务器在 X/Twitter 上无缝创建和安排帖子。它支持文本帖子、最多 4 张图片、最长 140 秒的视频,以及当内容超过 280 个字符时的自动线程拆分。用户需要注册一个付费的 Pro 或 Premium 计划以覆盖 Twitter API 成本。该技能提供了一组全面的 MCP 工具,包括创建帖子、管理媒体附件、列出连接和安排未来发布。此外,它提供了 REST API 后备方案,并详细记录了平台的限制、字符计数规则和线程行为。要点包括:图片会被自动转换为 PNG 格式(宽度最大 1000 像素),视频最大 512 MB 且最长 140 秒,表情符号计为 2 个字符,线程中仅第一条推文可以包含媒体。常见问题排查指南涵盖了关键错误及其解决方案。

兼容平台✓Claude Code✓Codex CLI✓Cursor
npx skills add https://github.com/publora/skills/tree/main/skills/x-post

Installed? Explore more 写作与编辑 skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

X/Twitter 帖子

使用 Publora MCP 服务器创建和安排 X (Twitter) 帖子。支持文本帖子、图片(最多 4 张)、视频,以及用于长内容的自动线程拆分。

前提条件

计划: 需要付费计划(X API 费用转嫁)。当前限制和定价:publora.com/pricing。

重要: 由于 Twitter API 费用,免费入门计划不提供 X/Twitter。

入门指南

  1. 创建账户 在 publora.com/register
  2. 选择 Pro 或 Premium 计划(X/Twitter 需要付费计划)
  3. 连接 X/Twitter 在 Publora 控制面板 中通过 OAuth 连接
  4. 获取 API 密钥 在 app.publora.com/dashboard/api
  5. 将你的代理连接到 MCP 服务器,地址为 https://mcp.publora.com,使用 Authorization: Bearer sk_YOUR_API_KEY 进行身份验证。在 Claude Code 中:
claude mcp add publora --transport http https://mcp.publora.com \
  --header "Authorization: Bearer sk_YOUR_API_KEY"

Claude Desktop、Cursor、Codex、OpenClaw 和 claude.ai 连接器各自需要不同的配置文件或流程:请参阅客户端设置获取确切的路径和代码片段。

REST API 后备

如果 MCP 不可用,请直接使用 REST API:

基础 URL: https://api.publora.com/api/v1

身份验证: x-publora-key 标头

# 获取已连接的平台
curl -X GET "https://api.publora.com/api/v1/platform-connections" \
  -H "x-publora-key: sk_your_api_key"

# 创建帖子
curl -X POST "https://api.publora.com/api/v1/create-post" \
  -H "x-publora-key: sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "platforms": ["twitter-123456789"],
    "content": "你的推文内容",
    "scheduledTime": "2026-03-25T10:00:00Z"
  }'

平台 ID 格式: twitter-{id}(例如,twitter-123456789)

📖 文档: docs.publora.com

平台限制

功能API 限制备注
字符数280表情符号计为 2 个字符
图片最多 4 张自动转换为 PNG(最大宽度 1000px)
视频时长2 分 20 秒(140 秒)Publora 将 X 视频验证为 140 秒
视频大小512 MBMP4、MOV 格式
线程拆分自动超过 280 个字符的内容使用 (1/N) 标记拆分

字符计数

X 有特定的字符计数规则,Publora 会自动处理:

  • 标准字符 = 1
  • 表情符号 = 2 个字符
  • URL 按字面长度计算
  • 线程标记为每条推文保留 10 个字符

自动线程拆分

当内容超过 280 个字符时,Publora 会自动创建一个连接的线程:

  1. 内容在段落分隔处拆分,然后是句子边界,再然后是单词边界
  2. 每个部分使用 (1/N)、(2/N) 格式编号
  3. 推文通过 X 的 reply_to_id 参数连接

手动线程分隔

在单独的行上使用 --- 强制进行线程分隔:

这是我在线程中的第一条推文。

---

这是我在线程中的第二条推文。

---

这是我在线程中的第三条推文!

可用工具

create_post

创建新的 X/Twitter 帖子或线程。

参数:

  • platforms:包含你的 X 连接 ID 的数组(例如,["twitter-12345678"])
  • content:帖子文本(如果超过 280 个字符则自动拆分为线程)
  • scheduledTime:ISO 8601 UTC 日期时间。可选:省略它会将帖子创建为草稿。发送未来的时间以安排发布。如果时间是过去五分钟或更久,将拒绝并返回 SCHEDULED_TIME_IN_PAST,因此对于立即发布,请使用当前时间加一分钟。
  • mediaUrls:最多 10 个公共 https 图片或视频 URL。Publora 在服务器端下载它们并在验证之前附加,因此媒体和安排在单次调用中完成。这是草稿后 get_upload_url 然后 complete_media 流程的一次性替代方案。摄入速率限制为每小时 60 个 URL。

get_upload_url

获取用于媒体上传的预签名 URL。

参数:

  • postGroupId:要附加媒体的帖子 ID
  • fileName:文件名(例如,“image.png”、“video.mp4”)
  • contentType:image/png、image/jpeg、video/mp4
  • type:"image" 或 "video"

complete_media

在预签名 PUT 成功后,完成通过 get_upload_url 上传的文件。可选,因为安排也会完成待处理的媒体,但提前调用它可以在发布前暴露格式和探测错误。对于使用 mediaUrls 附加的媒体不是必需的。

参数:

  • mediaId:由 get_upload_url 返回的 ID

list_connections

列出你已连接的账户及其平台 ID。首先调用此方法并逐字复制 ID;它们永远不可猜测。

list_posts / get_post / update_post / delete_post

管理已安排和草稿的帖子。update_post 也可以在草稿或已安排的帖子上修补 content 和 platforms,因此修正拼写错误或重新定位目标不再意味着删除和重新创建。delete_media 和 prune_media_reference 清理上传的文件。

示例

简单推文

将此发布到 X:
"刚刚发布了我们的新 API 文档。看看吧!"

带图片的推文

将此发布到 Twitter,附带新控制面板的截图:
"改版之前和之后。你觉得怎么样?"

注意:最多允许 4 张图片。所有图片自动转换为 PNG。

长格式线程

创建一个 Twitter 线程:
"线程:构建我们创业公司的 5 个教训

---

1. 尽早发布,快速迭代。我们用有缺陷的 MVP 启动了,并根据真实反馈进行了改进。

---

2. 每天与用户交谈。我们最好的功能来自客户对话。

---

3. 专注胜过功能。我们砍掉了 3 个产品,专注于那个有效的产品。"

已安排的推文

安排这条在明天上午 9 点发布:
"周一动力:在你准备好之前开始。"

重要限制

  1. 需要 Pro 计划:由于 Twitter API 费用,免费入门计划不提供 X/Twitter。

  2. 140 秒视频限制:Publora 将 X 视频验证为 2 分 20 秒(140 秒)。更长的视频会验证失败。

  3. 图片自动转换:所有图片在上传前都会转换为 PNG(最大宽度 1000px)。动画 GIF 会失去动画效果。

  4. 图片和视频不混合:一条推文可以有图片或视频,不能同时存在。

  5. 仅第一条推文的媒体:在线程中,图片/视频仅附加到第一条推文。

最佳实践

内容

  1. 第一行钩子:大多数互动发生在第一条推文上
  2. 最佳线程长度:3-7 条推文以获得最佳互动
  3. 表情符号意识:记住表情符号计为 2 个字符

时机

  • 最佳时间:目标时区的上午 8-10 点、中午 12-1 点、下午 5-6 点
  • 频率:每天 3-5 条推文以增长
  • 线程:在早上发布以获得最大可见性

互动

  • 在一小时内回复评论
  • 引用推文你自己的线程以增加可见性
  • 使用相关的标签(每条推文 1-2 个)

故障排查

错误原因解决方案
"X/Twitter requires Pro plan"使用入门计划在 publora.com/settings 升级到 Pro
"Content too long"超过 280 个字符且线程拆分失败添加手动 --- 分隔符
"Video too long"超过 140 秒将视频裁剪到 2 分 20 秒以下
"Too many images"超过 4 张图片减少到 4 张或更少
"Rate limit exceeded"X API 限制已到等待并重试

Individual skills in this repo

This repo contains 8 individual skills — each has its own dedicated page.

publora/bluesky-post

Use when the user wants to post or schedule to Bluesky through Publora. Handles the 300-character cap, auto-detected hashtags and links, up to 4 images, and videos. Alt text cannot be set through the API. Needs a Bluesky app password, never the main password. Not for Mastodon (use social-post).

publora/instagram-post

Use when the user wants to post or schedule to Instagram through Publora: a single image, a 2-10 image carousel, a Reel or a Story. Requires a Business account and an image or video; text-only posts are rejected by the API. Not for Threads (use threads-post).

publora/linkedin-analytics

Analyze LinkedIn performance and manage engagement through Publora. Use when the user asks how a LinkedIn post or account performed (impressions, reach, reactions, comments, reshares, follower growth) or wants to react, comment, reshare or resolve an @mention. Statistics run over the REST API, engagement over MCP tools. Not for creating posts (use linkedin-post).

publora/linkedin-post

Use when the user wants to publish or schedule a LinkedIn post through Publora: text, a multi-image grid, a video, a PDF document, or @mentions. Not for analytics, reactions, comments or reshares (use linkedin-analytics), and not for other platforms.

publora/social-post

Use when the user wants to post or schedule to YouTube, a Facebook Page or Mastodon through Publora. YouTube needs a video on every post, Facebook publishes to Pages only, Mastodon caps at 500 characters. Not for the platforms that have their own skill.

publora/telegram-post

Use when the user wants to post or schedule to a Telegram channel or group through Publora, using a bot. Covers Telegram markdown, silent delivery, link previews and forward protection. Bot API caps media captions at 1,024 characters and videos at 50 MB. Not for other platforms (each has its own skill).

publora/threads-post

Create and schedule Threads posts with image carousels and reply control via Publora MCP. Use when the user wants to post to Meta's Threads. Multi-part threading is currently disabled by the platform, so long content stays a single post. Not for Instagram (use instagram-post) or X threads (use x-post).

publora/tiktok-post

Use when the user wants to upload or schedule a TikTok video through Publora, with privacy, comment, duet, stitch and commercial-disclosure settings. Video runs 3 seconds to 10 minutes at 23+ FPS; carousels take up to 35 images. Unaudited apps can publish private videos only. Not for Reels (use instagram-post).

相关技能