hive.x-automation
Skill này làm gì
Skill này cung cấp cho AI các bước đã được thử nghiệm cho những tác vụ X phổ biến trong trình duyệt của bạn. Skill dành cho người muốn được hỗ trợ đăng bài, trả lời hoặc tìm kiếm mà không phải nhấp từng bước bằng tay.
Khi nào nên dùng
- ✓Khi bạn muốn một bài đăng hoặc trả lời được gửi lên X qua trình duyệt của mình.
- ✓Khi bạn muốn tìm kiếm trên X và trả lời các kết quả.
- ✓Khi bạn muốn xóa một bài đăng của mình trên X.
Liên kết skill
https://github.com/aden-hive/hive/blob/main/core/framework/skills/_preset_skills/x-automation/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tìm trên X các bài viết về công cụ AI và trả lời ba bài hữu ích nhất.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI dùng trình duyệt, chụp ảnh màn hình để tìm đúng vị trí và gõ vào hộp soạn của X. AI biết các điểm lạ có thể làm nút gửi không bật lên và tìm cách xử lý.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
X / Twitter Automation
X uses Draft.js (the original Facebook rich-text editor) for the compose text area, which was the original canary for all the rich-text editor quirks the browser-automation skill now documents. Most of the site is otherwise stable — data-testid attributes have held up for years, the SPA is reasonably honest about what it renders, and shadow DOM is minimal. The hard parts are the composer, rate limiting, and the occasional anti-bot challenge.
Always activate browser-automation first. This skill assumes you already know about CSS-px coordinates, click-first typing, and Input.insertText. The guidance below is X-specific.
Timing expectations
browser_navigate(wait_until="load")returns in 1.3–1.6 s on a warm cache.- After navigation,
sleep(2–3)for SPA hydration before querying selectors. - Compose modal slide-in: ~1.5 s after clicking reply / compose.
- First 1–2 characters typed into the compose editor may be dropped — see "Draft.js quirks" below.
Verified selectors (2026-04-11)
| Target | Selector |
|---|---|
| Home nav link | a[data-testid='AppTabBar_Home_Link'] |
| Explore nav link | a[data-testid='AppTabBar_Explore_Link'] |
| Notifications | a[data-testid='AppTabBar_Notifications_Link'] |
| Main search input | input[data-testid='SearchBox_Search_Input'] |
| Compose text area | [data-testid='tweetTextarea_0'] (Draft.js contenteditable) |
| Post / Tweet submit button | [data-testid='tweetButton'] |
| Reply button (on feed / tweet detail) | [data-testid='reply'] |
| Like button | [data-testid='like'] |
| Retweet / repost button | [data-testid='retweet'] |
| Caret (⋯) menu on a post | [data-testid='caret'] |
| Confirmation sheet confirm button | [data-testid='confirmationSheetConfirm'] |
| Tweet article wrapper | article[data-testid='tweet'] |
| Close modal / composer | [aria-label='Close'] or press Escape |
All of these are light-DOM data-testid attributes — wait_for_selector and browser_type(selector=...) work on them directly, no shadow piercing needed.
Post new tweet flow
browser_navigate("https://x.com/home", wait_until="load")
sleep(3)
# Open the compose UI (click the post-new-tweet nav or use shortcut N)
browser_press("n") # keyboard shortcut — opens compose modal
sleep(1.5)
# Click the textarea to make sure Draft.js is in edit mode
ta_rect = browser_get_rect("[data-testid='tweetTextarea_0']")
browser_click_coordinate(ta_rect.cx, ta_rect.cy)
sleep(0.5)
# Type — browser_type handles Draft.js correctly now via Input.insertText
browser_type("[data-testid='tweetTextarea_0']", tweet_text)
sleep(1.0) # let Draft.js commit state
# Verify the Post button is enabled — never click blindly, Draft.js sometimes
# doesn't register the input even with a prior click.
state = browser_evaluate("""
(function(){
const btn = document.querySelector('[data-testid="tweetButton"]');
if (!btn) return {found: false};
return {
found: true,
disabled: btn.disabled || btn.getAttribute('aria-disabled') === 'true',
};
})();
""")
if state['found'] and not state['disabled']:
browser_click("[data-testid='tweetButton']")
sleep(2)
browser_press("Escape") # close any leftover modal
Posting a tweet WITH an image
Critical: NEVER click the photo button. On x.com/compose/post the media button is a styled <button> that triggers Chrome's native OS file picker when clicked — that dialog is unreachable via CDP and will wedge the automation. Instead, set the file directly on the hidden <input type='file'> element using browser_upload:
# 1. Open the compose modal as usual
browser_press("n")
sleep(1.5)
browser_click_coordinate(ta_rect.cx, ta_rect.cy)
sleep(0.5)
browser_type("[data-testid='tweetTextarea_0']", tweet_text)
# 2. Find the hidden file input X uses for media uploads.
# X's input is marked with data-testid='fileInput' and accepts
# image/*,video/*. It's hidden (display:none) but still mounted.
inputs = browser_evaluate("""
(function(){
return Array.from(document.querySelectorAll('input[type="file"]'))
.map(el => ({
testid: el.getAttribute('data-testid') || '',
accept: el.accept || '',
multiple: el.multiple,
}));
})();
""")
# Expect to see: [{testid: 'fileInput', accept: 'image/jpeg,...', multiple: true}]
# 3. Set the file WITHOUT opening any dialog
browser_upload(
selector="input[data-testid='fileI
Câu hỏi thường gặp
Tại sao nút gửi đôi khi vẫn tắt?
Trình soạn thảo văn bản của X đôi khi âm thầm bỏ qua một số nội dung gõ vào, nên skill mô tả cách gõ để nút gửi được bật.
X có giới hạn số lần chạy tác vụ này không?
Skill lưu ý rằng có thể gặp giới hạn tốc độ và thỉnh thoảng có thử thách xác minh, và skill làm việc trong các giới hạn đó.
Skill bao quát những trang X nào?
Skill bao quát các trang chính như trang chủ, tìm kiếm, soạn bài và thông báo, với các selector được kiểm tra vào tháng 4 năm 2026.
Chi tiết
Mô tả gốc của tác giả
Read before automating X / Twitter with browser_* tools. Verified flows for post, reply, delete, search-and-engage, plus the Draft.js compose quirks that silently disable the send button. Includes the daily-reply and job-market-reply playbooks. Requires hive.browser-automation for the underlying screenshot + coordinate workflow. Verified 2026-04-11.
repo: aden-hive/hive
Độ phổ biến
- Sao GitHub
- 11k
- Vị trí xếp hạng
- #11817
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
browser-edge-cases
11kGiúp agent của bạn sửa tự động hóa trình duyệt bị lỗi trên các trang khó như LinkedIn, X hoặc trang có nhiều script nặng.
hive.browser-automation
11kDạy agent của bạn điều khiển trình Chrome của chính bạn bằng công cụ hive-browser, dùng ảnh chụp màn hình và các thao tác nhấp chuột.
hive.colony-progress-tracker
11kGiúp agent của bạn nhận tác vụ và ghi lại các bước cùng kiểm tra của nó vào một cơ sở dữ liệu dùng chung, để công việc được theo dõi khi tiến hành.
hive.context-preservation
11kGiúp agent của bạn lưu các dữ kiện quan trọng từ kết quả công cụ dài vào ghi chú trước khi những chi tiết cũ bị xóa khỏi bộ nhớ.
Skill tương tự
knowledge-automation
394kGiúp agent của bạn thiết lập tác vụ định kỳ đưa nội dung mới vào kho Knowledge theo lịch, rồi kiểm tra tác vụ có chạy không.
knowledge-source-ingest
394kGiúp agent của bạn cập nhật Knowledge vault với các mục mới từ kênh chat, nguồn tin hoặc hộp thư, mà không thêm lại những gì đã có.
benchmark
280kGiúp agent của bạn đo tốc độ và hiệu suất của code, hữu ích để đảm bảo mọi thứ nhanh và tìm ra những chỗ chậm.