Community程式設計與開發github.com

bosshuman/openclaw-x

操控你的 X/Twitter 帳號——查看時間軸、搜尋推文、發推、按讚、轉推、收藏。

openclaw-x 是什麼?

OpenClaw X 是一項讓 AI 代理(如 Claude Code、Cursor 或 Codex)能直接操控 X/Twitter 帳號的技能。透過其本地 API 服務,代理可以執行多種社交媒體操作,包括獲取首頁時間軸、檢視推文詳情、搜尋推文、發布新推文、按讚、轉推及收藏。此技能特別適合自動化社群管理、監控趨勢話題或執行內容排程等場景。支援的搜尋排序包含「最新」與「熱門」,並可自訂結果數量。使用者需先從 GitHub Release 下載對應平台的可執行檔,並從瀏覽器匯出 X 的 cookies(使用 Cookie-Editor 擴充功能)後啟動本地服務。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add bosshuman/openclaw-x

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

OpenClaw X

透過本地 API 操控你的 X/Twitter 帳號。

前置要求

  1. 從 GitHub Release 下載對應平台的可執行檔
  2. 從 Chrome 匯出 X 的 cookies(使用 Cookie-Editor 擴充功能),儲存為 cookies.json 放在可執行檔同目錄
  3. 執行可執行檔,確保服務已啟動:http://localhost:19816

可用操作

1. 取得首頁時間軸

curl http://localhost:19816/timeline?count=20

返回最新的推文列表,包含內容、作者、媒體 URL 等。

2. 取得推文詳情

curl http://localhost:19816/tweet/{tweet_id}

支援傳入推文 ID 或完整 URL(如 https://x.com/user/status/123456)。

3. 搜尋推文

curl "http://localhost:19816/search?q=關鍵詞&sort=Latest&count=20"

參數:

  • q:搜尋關鍵詞(必填)
  • sort:Latest(最新)或 Top(熱門),預設 Latest
  • count:結果數量,預設 20

4. 發推文

curl -X POST http://localhost:19816/tweet \
  -H "Content-Type: application/json" \
  -d '{"text": "你好世界"}'

回覆推文:

curl -X POST http://localhost:19816/tweet \
  -H "Content-Type: application/json" \
  -d '{"text": "回覆內容", "reply_to": "原推文ID"}'

5. 按讚推文

curl -X POST http://localhost:19816/tweet/{tweet_id}/like

6. 轉推

curl -X POST http://localhost:19816/tweet/{tweet_id}/retweet

7. 收藏推文

curl -X POST http://localhost:19816/tweet/{tweet_id}/bookmark

8. 取得使用者資訊

curl http://localhost:19816/user/{username}

返回使用者名稱、頭像、簡介、粉絲數等。

9. 取得使用者推文

curl http://localhost:19816/user/{username}/tweets?count=20

常見使用場景

  1. 「幫我看看我的時間軸有什麼新推」
  2. 「搜尋關於 AI Agent 的最新推文」
  3. 「發一條推文說:今天天氣真好」
  4. 「幫我按讚這條推文 https://x.com/xxx/status/123」
  5. 「看看 @elonmusk 最近發了什麼」
  6. 「幫我收藏這條推文」

相關技能