x-twitter

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
X (Twitter) API v2 skill using the authenticated user's own developer credentials (OAuth 1.0a, pay-per-use). All commands go through a single entry point:
node <base_directory>/x.js <command> [flags]
. Each command has its own doc file with the full reference for flags and behavior.
[!SETUP] Before first use, check whether
<base_directory>/node_modules
exists. If it does NOT exist, run
npm install --prefix <base_directory>
. Then check whether
<base_directory>/dist/x.js
exists. If it does NOT exist, run
npm run build --prefix <base_directory>
. NEVER cd into the skill directory; use --prefix to target it without changing your working directory.
[!COMMANDS]
Core: a)
me
— authenticated user's own account data (profile, metrics, verification). @docs/me.md. b)
search
— search posts by query (last 7 days or full archive). @docs/search.md. c)
get
— retrieve one or more posts by ID. @docs/get.md. d)
post
— create a tweet, reply, or quote tweet. @docs/post.md. e)
delete
— delete a post owned by the authenticated user. @docs/delete.md.
Engagement: f)
like
— like a post by tweet ID. @docs/like.md. g)
unlike
— remove a like from a post. @docs/like.md. h)
repost
— repost (retweet) a post. @docs/repost.md. i)
unrepost
— remove a repost. @docs/repost.md.
Social: j)
user
— look up user(s) by username or ID. @docs/user.md. k)
follow
— follow a user by username or ID. @docs/follow.md. l)
unfollow
— unfollow a user. @docs/follow.md. m)
followers
— list a user's followers. @docs/followers.md. n)
following
— list accounts a user follows. @docs/followers.md.
Feed: o)
timeline
— your home timeline (reverse chronological). @docs/timeline.md. p)
mentions
— posts that mention you. @docs/mentions.md.
Bookmarks: q)
bookmark
— bookmark a post. @docs/bookmark.md. r)
unbookmark
— remove a bookmark. @docs/bookmark.md. s)
bookmarks
— list your bookmarks. @docs/bookmark.md.
Moderation: t)
mute
— mute a user. @docs/mute.md. u)
unmute
— unmute a user. @docs/mute.md. v)
muted
— list muted accounts. @docs/mute.md. w)
blocked
— list blocked accounts. @docs/blocked.md. x)
hide-reply
— hide a reply to your post. @docs/hide-reply.md.
Analytics: y)
likers
— users who liked a post. @docs/likers.md. z)
reposters
— users who reposted a post. @docs/reposters.md. aa)
quotes
— quote tweets of a post. @docs/quotes.md. ab)
count
— count posts matching a query over time. @docs/count.md. ac)
reposts-of-me
— reposts of your posts by others. @docs/reposts-of-me.md.
Discovery: ad)
search-users
— search users by query. @docs/search-users.md. ae)
trending
— trending topics (worldwide or personalized). @docs/trending.md.
[!CREDENTIALS] Four OAuth 1.0a variables are REQUIRED:
X_API_KEY
,
X_API_SECRET
,
X_ACCESS_TOKEN
,
X_ACCESS_TOKEN_SECRET
. They resolve from the first source that provides them: a)
.env.local
in cwd, b)
.env
in cwd, c)
.env.local
in the plugin directory, d)
.env
in the plugin directory, e) environment variables. Obtain them from the X Developer Console (Apps > Keys and tokens).
本X(Twitter)API v2 Skill使用经过认证的用户自身开发者凭证(OAuth 1.0a,按使用付费)。所有命令都通过单一入口执行:
node <base_directory>/x.js <command> [flags]
。每个命令都有对应的文档文件,包含参数和行为的完整参考说明。
[!SETUP] 首次使用前,请检查
<base_directory>/node_modules
是否存在。如果不存在,请运行
npm install --prefix <base_directory>
。然后检查
<base_directory>/dist/x.js
是否存在。如果不存在,请运行
npm run build --prefix <base_directory>
。切勿进入Skill目录;请使用--prefix参数来指定目标目录,无需更改当前工作目录。
[!COMMANDS]
核心功能: a)
me
— 获取已认证用户的自身账户数据(个人资料、指标、认证信息)。参考@docs/me.md。 b)
search
— 根据查询条件搜索推文(最近7天或完整归档内容)。参考@docs/search.md。 c)
get
— 根据ID获取一条或多条推文。参考@docs/get.md。 d)
post
— 创建推文、回复推文或引用推文。参考@docs/post.md。 e)
delete
— 删除已认证用户发布的推文。参考@docs/delete.md。
互动功能: f)
like
— 根据推文ID点赞某条推文。参考@docs/like.md。 g)
unlike
— 取消对某条推文的点赞。参考@docs/like.md。 h)
repost
— 转发(Retweet)某条推文。参考@docs/repost.md。 i)
unrepost
— 取消转发。参考@docs/repost.md。
社交功能: j)
user
— 根据用户名或ID查找用户。参考@docs/user.md。 k)
follow
— 根据用户名或ID关注用户。参考@docs/follow.md。 l)
unfollow
— 取消关注用户。参考@docs/follow.md。 m)
followers
— 列出某用户的粉丝。参考@docs/followers.md。 n)
following
— 列出某用户关注的账号。参考@docs/followers.md。
动态流: o)
timeline
— 你的主页动态流(按时间倒序排列)。参考@docs/timeline.md。 p)
mentions
— 提及你的推文。参考@docs/mentions.md。
书签: q)
bookmark
— 为推文添加书签。参考@docs/bookmark.md。 r)
unbookmark
— 取消推文的书签。参考@docs/bookmark.md。 s)
bookmarks
— 列出你的所有书签。参考@docs/bookmark.md。
审核功能: t)
mute
— 屏蔽用户。参考@docs/mute.md。 u)
unmute
— 取消屏蔽用户。参考@docs/mute.md。 v)
muted
— 列出已屏蔽的账号。参考@docs/mute.md。 w)
blocked
— 列出已拉黑的账号。参考@docs/blocked.md。 x)
hide-reply
— 隐藏对你推文的回复。参考@docs/hide-reply.md。
分析功能: y)
likers
— 获取点赞某条推文的用户列表。参考@docs/likers.md。 z)
reposters
— 获取转发某条推文的用户列表。参考@docs/reposters.md。 aa)
quotes
— 获取某条推文的引用推文。参考@docs/quotes.md。 ab)
count
— 统计一段时间内符合查询条件的推文数量。参考@docs/count.md。 ac)
reposts-of-me
— 获取其他用户转发你推文的内容。参考@docs/reposts-of-me.md。
发现功能: ad)
search-users
— 根据查询条件搜索用户。参考@docs/search-users.md。 ae)
trending
— 获取热门话题(全球或个性化)。参考@docs/trending.md。
[!CREDENTIALS] 必须配置四个OAuth 1.0a变量:
X_API_KEY
X_API_SECRET
X_ACCESS_TOKEN
X_ACCESS_TOKEN_SECRET
。系统会按以下优先级顺序读取这些变量:a) 当前工作目录下的
.env.local
文件,b) 当前工作目录下的
.env
文件,c) 插件目录下的
.env.local
文件,d) 插件目录下的
.env
文件,e) 环境变量。你可以从X开发者控制台(应用>密钥和令牌)获取这些凭证。