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)
— authenticated user's own account data (profile, metrics, verification). @docs/me.md.
b)
— search posts by query (last 7 days or full archive). @docs/search.md.
c)
— retrieve one or more posts by ID. @docs/get.md.
d)
— create a tweet, reply, or quote tweet. @docs/post.md.
e)
— delete a post owned by the authenticated user. @docs/delete.md.
Engagement:
f)
— like a post by tweet ID. @docs/like.md.
g)
— remove a like from a post. @docs/like.md.
h)
— repost (retweet) a post. @docs/repost.md.
i)
— remove a repost. @docs/repost.md.
Social:
j)
— look up user(s) by username or ID. @docs/user.md.
k)
— follow a user by username or ID. @docs/follow.md.
l)
— unfollow a user. @docs/follow.md.
m)
— list a user's followers. @docs/followers.md.
n)
— list accounts a user follows. @docs/followers.md.
Feed:
o)
— your home timeline (reverse chronological). @docs/timeline.md.
p)
— posts that mention you. @docs/mentions.md.
Bookmarks:
q)
— bookmark a post. @docs/bookmark.md.
r)
— remove a bookmark. @docs/bookmark.md.
s)
— list your bookmarks. @docs/bookmark.md.
Moderation:
t)
— mute a user. @docs/mute.md.
u)
— unmute a user. @docs/mute.md.
v)
— list muted accounts. @docs/mute.md.
w)
— list blocked accounts. @docs/blocked.md.
x)
— hide a reply to your post. @docs/hide-reply.md.
Analytics:
y)
— users who liked a post. @docs/likers.md.
z)
— users who reposted a post. @docs/reposters.md.
aa)
— quote tweets of a post. @docs/quotes.md.
ab)
— count posts matching a query over time. @docs/count.md.
ac)
— reposts of your posts by others. @docs/reposts-of-me.md.
Discovery:
ad)
— search users by query. @docs/search-users.md.
ae)
— trending topics (worldwide or personalized). @docs/trending.md.
[!CREDENTIALS] Four OAuth 1.0a variables are REQUIRED:
,
,
,
. They resolve from the first source that provides them: a)
in cwd, b)
in cwd, c)
in the plugin directory, d)
in the plugin directory, e) environment variables. Obtain them from the X Developer Console (Apps > Keys and tokens).