Include long-form tweet fields in read shortcut#83
Open
jack4452 wants to merge 1 commit into
Open
Conversation
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This updates the
xurl readshortcut to request X's long-form post fields:note_tweetarticleX can return a shortened legacy/preview value in
data.textfor Premium long-form posts, while the full rendered body is available indata.note_tweet.text(or, for article-style posts,data.article). Without requesting those fields,xurl readcan 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 readonly showed the shorteneddata.textpreview. A raw request withtweet.fields=note_tweet,articlereturned the full body underdata.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
note_tweet,articleto thetweet.fieldsused byReadPost.TestReadPostto assert that anote_tweet.textpayload is preserved in the returned JSON.Test plan
gofmt -w api/shortcuts.go api/shortcuts_test.gogo test ./...go build ./...tweet.fields=note_tweet,articlereturns the full long-form post body indata.note_tweet.textfor a real Premium long post whiledata.textremains shortened.