Skip to content

Include long-form tweet fields in read shortcut#83

Open
jack4452 wants to merge 1 commit into
xdevplatform:mainfrom
jack4452:add-long-form-fields-to-read
Open

Include long-form tweet fields in read shortcut#83
jack4452 wants to merge 1 commit into
xdevplatform:mainfrom
jack4452:add-long-form-fields-to-read

Conversation

@jack4452

@jack4452 jack4452 commented Jul 10, 2026

Copy link
Copy Markdown

Summary

This updates the xurl read shortcut to request X's long-form post fields:

  • note_tweet
  • article

X can return a shortened legacy/preview value in data.text for Premium long-form posts, while the full rendered body is available in data.note_tweet.text (or, for article-style posts, data.article). Without requesting those fields, xurl read can make a valid long post look truncated to CLI users and automation.

Why

We hit this with a Premium account posting a long-form podcast announcement. The post rendered correctly on x.com, but the API response from xurl post / xurl read only showed the shortened data.text preview. A raw request with tweet.fields=note_tweet,article returned the full body under data.note_tweet.text.

Requesting these fields by default keeps the existing JSON shape intact and simply exposes the additional long-form payload when X returns it.

Changes

  • Adds note_tweet,article to the tweet.fields used by ReadPost.
  • Updates the shortcut test server to require those fields for read requests.
  • Extends TestReadPost to assert that a note_tweet.text payload is preserved in the returned JSON.

Test plan

  • gofmt -w api/shortcuts.go api/shortcuts_test.go
  • go test ./...
  • go build ./...
  • Manually verified against the X API that requesting tweet.fields=note_tweet,article returns the full long-form post body in data.note_tweet.text for a real Premium long post while data.text remains shortened.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@drQedwards

Copy link
Copy Markdown

don't forget to sign the cla, and I'm wondering if quoting a long form post can be greatly improved with this

@jack4452 jack4452 force-pushed the add-long-form-fields-to-read branch from 403c625 to a46d427 Compare July 14, 2026 15:41
@jack4452

Copy link
Copy Markdown
Author

I have signed the CLA as jack4452, but the CLA Assistant status did not refresh. The recheck URL redirects to the GitHub dashboard, and after pushing a fresh commit to trigger a new synchronize event, no CLA status has been reported for the new commit yet. Could a maintainer please re-trigger the CLA check or confirm whether the integration is currently working?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants