Community寫作與編輯github.com

Publora X/Twitter 發文工具

當使用者想透過 Publora 在 X (Twitter) 上發文或排程貼文時使用,包括自動將超過 280 字元的內容拆分成串文,支援最多 4 張圖片或最長 140 秒的影片。X 功能需要 Publora 付費方案。不適用於 Threads 或 Bluesky(各自有獨立工具)。

Twitter 發文工具 是什麼?

此技能透過 Publora MCP 伺服器,讓 AI 代理能在 X/Twitter 上建立並排程貼文。它支援純文字、最多 4 張圖片、最長 140 秒的影片,以及自動串文功能(自動將超過 280 字元的內容分割成多則推文)。使用此技能需要 Pro 或更高階的 Publora 方案,因為 Twitter API 的費用會轉嫁給使用者。技能提供了兩種整合方式:MCP(透過 `claude mcp add publora` 等指令設定)以及 REST API 備援方案(用於 MCP 無法使用時)。平台限制包括每則推文最多 280 字元(表情符號算 2 字元)、單一貼文最多 4 張圖片或一段影片,且圖片會自動轉換為 PNG 格式。串文功能支援手動斷點(使用 `---`),並提供多個工具(`create_post`、`get_upload_url`、`complete_media`、`list_connections` 等)來管理貼文的整個生命週期。技能中也詳細說明了字元計數規則、疑難排解,以及內容與時機的最佳實踐。

相容平台✓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 不適用於免費的 Starter 方案。

開始使用

  1. 在 publora.com/register 建立帳戶
  2. 選擇 Pro 或 Premium 方案(X/Twitter 需要付費方案)
  3. 在 Publora Dashboard 中透過 OAuth 連結 X/Twitter
  4. 在 app.publora.com/dashboard/api 取得 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;這些 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 不包含在免費的 Starter 方案中。

  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 需要 Pro 方案」使用 Starter 方案在 publora.com/settings 升級至 Pro
「內容過長」超過 280 字元且串文失敗加入手動 --- 斷點
「影片過長」超過 140 秒將影片修剪至 2 分 20 秒以下
「圖片過多」超過 4 張圖片減少至 4 張或更少
「達到速率限制」已達 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).

相關技能