Commit 82852bb
committed
feat(parity): close XActions feature gaps + fix retweet/longform rendering
User confirmed v0.4 works end-to-end (auth import via headless Chrome,
tweets list returns real data with HumanCount metrics + emojis +
Chinese rendering correct). Their tweets list output also surfaced
two real rendering bugs and several missing scrape commands vs
XActions. This commit closes the gap.
## Parser fixes
api/tweets.go ParseTweet:
Longform "note tweets" support. X Premium users can post tweets up
to 25k chars via the note_tweet feature. The full body lives at
note_tweet.note_tweet_results.result.text
while legacy.full_text only carries the truncated 280-char preview
with a `…` marker. ParseTweet now reads note_tweet first and falls
back to legacy.full_text. XActions misses this too — we're now
ahead.
## Rendering fixes
cmd/tweets.go formatTweetRow (new):
Replaces the inline format string with a structured renderer that
fixes three problems from the user's live test output:
1. Retweets showed `RT @user: <truncated>` because legacy.full_text
for a retweet is the truncated retweet header. The actual
retweeted content is in RetweetOf.Text. We now display
"RT @<original_author>: <full content>" using the parsed
retweet payload.
2. Replies, quotes, and media were invisible. The new format
adds:
↳ for replies
→q for tweets that quote another
📷N for N image attachments
🎬N for video
🎞N for animated GIFs
so a glance at the list tells you what's a thread reply, what
quotes another tweet, and what has media.
3. Quotes count was missing from the metrics. We now show
L (likes), R (retweets), Q (quotes), V (views) in compact
HumanCount form (1.2k, 3.4M).
Truncation is bumped from 100 to 120 runes since we have more
signal density now.
## New scrape commands (XActions parity)
cmd/relationships.go:
x likes <tweet-id|url> users who liked a tweet (Favoriters)
x retweeters <tweet-id|url> users who retweeted
x nonfollowers <screen-name> XActions' #1 feature: scrape both
followers and following lists, take
the set difference (following \\
followers), report who doesn't
follow you back
All three reuse the existing relationships.go renderer, support
--json and -n/--limit, and route through the throttle.
## New engagement mutations
api/actions.go:
LikeTweet / UnlikeTweet FavoriteTweet / UnfavoriteTweet
BookmarkTweet / UnbookmarkTweet CreateBookmark / DeleteBookmark
All four go through a new graphqlMutation helper that calls
Client.GraphQL and pipes the response through classifyMutationErrors
— same idempotent / rate-limit / not-found dispatch as the REST
follow path. "You have already favorited" becomes a silent success
so re-runs are safe.
cmd/engage.go (new):
x engage like <tweet> x engage unlike <tweet>
x engage bookmark <tweet> x engage unbookmark <tweet>
Each subcommand uses Go method values ((*api.Client).LikeTweet,
etc.) to share one runEngageOp helper without duplicating the
client-construction boilerplate four times. No --apply gate
because each call targets one tweet — for bulk mutations the
user goes through `x grow` which has --max + --min-followers +
--apply + --i-know-its-a-cloud-ip.
endpoints.yaml:
+ FavoriteTweet lI07N6Otwv1PhnEgXILM7A
+ UnfavoriteTweet ZYKSe-w7KEslx3JhSIk5LA
+ CreateRetweet ojPdsZsimiJrUGLR1sjUtA
+ DeleteRetweet iQtK4dl5hBmXewYZuEOKVw
+ CreateBookmark aoDbu3RHznuiSkQ9aNM67Q
+ DeleteBookmark Wlmlj2-xzyS1GN3a6cj-mQ
All marked kind: mutation with rps 0.1 / burst 1 so the read
bucket throttles them without sharing budget with the friendships
daily cap. CreateRetweet / DeleteRetweet are wired in the YAML so
a future commit can add `x engage retweet` without touching the
schema.
## What's still XActions-only
- postTweet / replyToTweet / quoteTweet / deleteTweet
(writing tweets) — out of scope for v1
- DMs — privacy-sensitive, deferred
- blockUser / muteUser — easy to add but not urgent
- scrapeListMembers — easy to add when someone needs it
- schedulePost / postThread / chunked media upload
— write-side, out of scope1 parent 86d4bb2 commit 82852bb
6 files changed
Lines changed: 380 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
53 | 92 | | |
54 | 93 | | |
55 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
279 | 292 | | |
280 | 293 | | |
281 | | - | |
| 294 | + | |
282 | 295 | | |
283 | 296 | | |
284 | 297 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
35 | 65 | | |
36 | 66 | | |
37 | 67 | | |
| |||
40 | 70 | | |
41 | 71 | | |
42 | 72 | | |
43 | | - | |
| 73 | + | |
44 | 74 | | |
45 | 75 | | |
46 | 76 | | |
47 | 77 | | |
48 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
49 | 185 | | |
50 | 186 | | |
51 | 187 | | |
| |||
0 commit comments