一键导入
x-automation
X.com (Twitter) automation via Patchright MCP — post, reply, like, retweet, DM, search, profile. English UI. Part of social-media-browser umbrella.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
X.com (Twitter) automation via Patchright MCP — post, reply, like, retweet, DM, search, profile. English UI. Part of social-media-browser umbrella.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Threads (threads.com) search & data extraction — cari post, extract comments/replies, scroll pagination. Browser-based via Patchright MCP.
X.com (Twitter) search & data extraction — cari post dengan advanced operators, extract replies, scroll pagination. Browser-based via Patchright MCP.
Instagram automation via Patchright MCP — DM, like, comment, search, profile, get images. Browser-based (not API). Part of social-media-browser umbrella.
Threads (threads.com) automation via Patchright MCP — post, reply, like, repost, DM, search, profile. Column-based web UI, English. Part of social-media-browser umbrella.
| name | x-automation |
| description | X.com (Twitter) automation via Patchright MCP — post, reply, like, retweet, DM, search, profile. English UI. Part of social-media-browser umbrella. |
| triggers | ["x.com","twitter","tweet","post x","reply x","like tweet","dm x","retweet","search x","profil x"] |
| tools | ["mcp_patchright_browser_navigate","mcp_patchright_browser_click","mcp_patchright_browser_type","mcp_patchright_browser_snapshot","mcp_patchright_browser_run_code","mcp_patchright_browser_file_upload","mcp_patchright_browser_take_screenshot"] |
profile="rickicode" (default) or whichever profile has X sessionmcp_patchright_* toolsX.com uses a fixed sidebar + main content layout:
| Item | Label | URL |
|---|---|---|
| X logo | link "X" | /home |
| Home | link "Home" | /home |
| Search | link "Search and explore" | /explore |
| Notifications | link "Notifications" | /notifications |
| Follow | link "Follow" | /i/connect_people |
| DM | link "Direct Messages" | /i/chat |
| Grok | link "Grok" | /i/grok |
| Bookmarks | link "Bookmarks" | /i/bookmarks |
| Creator Studio | link "Creator Studio" | /i/jf/creators/studio |
| Premium | link "Premium" | /i/premium_sign_up |
| Profile | link "Profile" | /<username> |
| More | button "More menu items" | — |
| Post | link "Post" | /compose/post |
| Account | button "Account menu" | — |
Located at top of home timeline:
textbox "Post text" — main inputbutton "Post" — publish (disabled until text entered)button "Add photos or video" + button "Choose File" — media uploadbutton "Add a GIF" — GIF pickerbutton "Generate image" — AI image generationbutton "Add poll" — create pollbutton "Add emoji" — emoji pickerbutton "Schedule post" — schedule for laterbutton "Tag location" — add locationbutton "Content disclosure" — content warningsasync (page) => {
await page.goto('https://x.com/home');
await page.waitForTimeout(3000);
// Click compose
const textbox = page.getByRole('textbox', { name: 'Post text' });
await textbox.click();
await textbox.fill('Your tweet text here');
await page.waitForTimeout(500);
// Click Post
await page.getByRole('button', { name: 'Post' }).click();
await page.waitForTimeout(2000);
return 'posted';
}
Action bar: button "N Likes. Like" or button "N Likes. Liked"
run_code:
async (page) => {
const likeBtn = page.getByRole('button', { name: /Likes.*Like/ }).first();
await likeBtn.click();
await page.waitForTimeout(500);
return 'liked';
}
Action bar: button "N Replies. Reply"
From post detail page:
/<username>/status/<id>Action bar: button "N reposts. Repost" or button "N reposts. Reposted"
Quote Repost:
Action bar: button "Bookmark"
/i/bookmarksAction bar: button "Share post"
Action bar: link "N views. View post analytics" → /<username>/status/<id>/analytics
button "More" on your post)menuitem "Delete" — delete postmenuitem "Pin to your profile" — pin to topmenuitem "Highlight on your profile" — highlightmenuitem "Add/remove from Lists" — manage listsmenuitem "Add/remove content disclosure" — content warningsmenuitem "Change who can reply" — reply controlsmenuitem "View post activity" — engagement detailsmenuitem "Embed post" — embed codemenuitem "View post analytics" — detailed analyticsmenuitem "Request Community Note" — fact-check requestbutton "More" on their post)menuitem "Follow @username" — followmenuitem "Subscribe to @username" — subscribemenuitem "Add/remove from Lists" — manage listsmenuitem "Mute" — mute usermenuitem "Block @username" — block usermenuitem "View post activity" — engagementmenuitem "Embed post" — embed codemenuitem "Report post" — reportmenuitem "Request Community Note" — fact-checkrun_code to click menu item:
async (page) => {
// Click More button on post
await page.evaluate(() => {
const articles = document.querySelectorAll('article');
if (articles.length > 0) {
const moreBtn = articles[0].querySelector('button[aria-label="More"]');
if (moreBtn) moreBtn.click();
}
});
await page.waitForTimeout(1000);
// Click menu item
const menuItem = page.getByRole('menuitem', { name: 'Delete' });
await menuItem.click();
await page.waitForTimeout(1000);
// Confirm if dialog
const confirmBtn = page.getByRole('button', { name: /Delete|Confirm/ });
if (await confirmBtn.isVisible()) {
await confirmBtn.click();
}
return 'done';
}
Navigate: https://x.com/i/chat
IMPORTANT: X has replaced traditional DMs with X Chat featuring end-to-end encryption. Requires passcode setup before use.
/i/chat/pin/newdata-testid="pin-onboarding-setup-now" → "Create Passcode"icon-dms-lock, icon-dms-shield, icon-passcode/i/chat) — dedicated pagedata-testid="chat-drawer-main" → slide-out paneldata-testid="chat-drawer-root"data-testid="chat-drawer-main" — drawer toggle buttondata-testid="chat-drawer-root" — drawer containerdata-testid="pin-onboarding-title" — onboarding titledata-testid="pin-onboarding-setup-now" — setup buttonNavigate: https://x.com/explore
Search box: combobox "Search query" in right sidebar or explore page
Search URL: https://x.com/search?q=<query>&src=typed_query
Navigate: https://x.com/<username>
Structure:
a[href*="/header_photo"] img (600x200)a[href*="/photo"] img (200x200)h2 heading + verified badge svg[data-testid="icon-verified"]@<username> in [data-testid="UserName"][data-testid="UserDescription"]a[href*="/about"] containing "Joined" (e.g., "Joined July 2013")a[href$="/following"] (e.g., "86 Following")a[href$="/verified_followers"] (e.g., "3,967 Followers")[data-testid="UserLocation"] (if set)[data-testid="UserUrl"] (if set)Tabs (nav[aria-label="Profile timelines"]):
Action Buttons (own profile):
a[href="/settings/profile"] → "Edit profile"button[aria-label="Profile Summary"] → summarybutton[aria-label="Search"] → search user's postsAction Buttons (other user):
button "Follow @username" / button "Following"button[data-testid="message"] → DMbutton[data-testid="userActions"] → More optionsPost Grid:
article[data-testid="tweet"][data-testid="tweetText"] → post texttime element → timestamp + post URL (/<username>/status/<id>)img[src*="pbs.twimg.com"] → images[data-testid="reply"] → reply count[data-testid="retweet"] → repost count[data-testid="like"] → like countImage URLs:
https://pbs.twimg.com/profile_images/<id>_<hash>_<size>.jpghttps://pbs.twimg.com/profile_banners/<user_id>/<banner_id>/600x200https://pbs.twimg.com/media/<id>?format=jpg&name=smallExtract profile data:
async (page) => {
await page.goto('https://x.com/username');
await page.waitForTimeout(5000);
return await page.evaluate(() => {
const result = {};
result.displayName = document.querySelector('h2')?.textContent;
result.username = document.querySelector('[data-testid="UserName"]')?.textContent;
result.bio = document.querySelector('[data-testid="UserDescription"]')?.textContent;
result.following = document.querySelector('a[href$="/following"]')?.textContent;
result.followers = document.querySelector('a[href$="/verified_followers"]')?.textContent;
result.joinDate = document.querySelector('a[href*="/about"]')?.textContent;
// Get posts
const articles = document.querySelectorAll('article[data-testid="tweet"]');
result.posts = [...articles].map(a => ({
text: a.querySelector('[data-testid="tweetText"]')?.textContent?.substring(0, 100),
time: a.querySelector('time')?.getAttribute('datetime'),
url: a.querySelector('time')?.closest('a')?.href,
images: [...a.querySelectorAll('img[src*="pbs.twimg.com/media"]')].map(i => i.src)
}));
return result;
});
}
Navigate: https://x.com/notifications
Page header: h2 "Notifications" + a[href="/settings/notifications"] (Settings gear icon)
Filter Tabs (nav[aria-label="Notifications timelines"] + div[role="tablist"]):
a[role="tab"][href="/notifications"] → All (default selected)a[role="tab"][href="/notifications/priority"] → Priority (high-priority accounts)a[role="tab"][href="/notifications/mentions"] → Mentions (only @mentions)Notification Types:
Each notification is an article[data-testid="notification"] inside div[aria-label="Timeline: Notifications"].
Activity notifications (likes, retweets, follows):
[data-testid="UserAvatar-Container-{username}"][data-testid="tweetText"]button[aria-label="More"][data-testid="caret"]Pinned post notifications (community):
Mentions (empty state):
Action Buttons:
button[aria-label="More"][data-testid="caret"] — context menu on each notification/settings/notificationsKey data-testids:
[data-testid="notification"] — notification article[data-testid="UserAvatar-Container-{username}"] — user avatar[data-testid="tweetText"] — post text[data-testid="caret"] — More buttonDOM Hierarchy:
<main>
div[aria-label="Home timeline"]
├── h2 "Notifications" + Settings link
├── nav[aria-label="Notifications timelines"] → tablist (All, Priority, Mentions)
├── section[aria-label="Notifications"]
│ └── div[aria-label="Timeline: Notifications"]
│ └── article[data-testid="notification"] (×N)
│ ├── SVG type icon (star/pin)
│ ├── User avatar + username + timestamp
│ ├── [data-testid="tweetText"]
│ └── button[aria-label="More"][data-testid="caret"]
└── Right sidebar: Trending, Who to follow
button "Follow @username" → click to followbutton "Following" → click to unfollowmenuitem "Follow @username" in More menuNavigate: https://x.com/i/bookmarks
Navigate: https://x.com/i/lists
Navigate: https://x.com/i/grok
button "Grok actions" on posts — analyze with GrokNavigate: https://x.com/i/jf/creators/studio
Navigate: https://x.com/i/premium_sign_up
| Action | URL |
|---|---|
| Home | https://x.com/home |
| Explore | https://x.com/explore |
| Search | https://x.com/search?q=<query>&src=typed_query |
| Notifications | https://x.com/notifications |
| Mentions | https://x.com/notifications/mentions |
| DM | https://x.com/i/chat |
| Bookmarks | https://x.com/i/bookmarks |
| Lists | https://x.com/i/lists |
| Grok | https://x.com/i/grok |
| Creator Studio | https://x.com/i/jf/creators/studio |
| Premium | https://x.com/i/premium_sign_up |
| Profile | https://x.com/<username> |
| Profile Replies | https://x.com/<username>/replies |
| Profile Media | https://x.com/<username>/media |
| Profile Likes | https://x.com/<username>/likes |
| Post Detail | https://x.com/<username>/status/<id> |
| Post Analytics | https://x.com/<username>/status/<id>/analytics |
| Compose | https://x.com/compose/post |
| DM Chat | https://x.com/i/chat |
| DM Setup | https://x.com/i/chat/pin/new |
| Follow suggestions | https://x.com/i/connect_people |
waitForTimeout(5000-10000) after navigation.snapshot fresh.textbox "Post text" + button "Post" (disabled until text entered).button "More" with aria-label="More" on each post.button "Grok actions" on posts for AI analysis./<username>/status/<numeric_id>/i/chat (not /messages/ like Threads)img "Verified account" badge next to name.button "Schedule post" for delayed publishing.button "Generate image" for AI image creation./i/chat/pin/new). Two modes: full-page and floating drawer.data-testid extensively — tweet, tweetText, notification, caret, UserName, UserDescription, UserAvatar-Container-{username}, reply, retweet, like.pbs.twimg.com domain. Profile: /profile_images/, Banner: /profile_banners/, Media: /media/.button "Grok actions" on each post for AI analysis.button "Schedule post" for delayed publishing.button "Content disclosure" for content warnings.