Repository navigation
feat: make X Articles first-class resources - #57
Open
robertn702 wants to merge 5 commits into
Open
robertn702 wants to merge 5 commits into
robertn702 wants to merge 5 commits into
Conversation
This branch has not been deployed
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.
What changed
Make X Articles first-class resources across the CLI and its read surfaces:
x article <article-id-or-url>reads a long-form Article as its own record, with title, full body, structuredcontent_state, cover, inline media, author, and linking post.x get <article-url>dispatches to Article;x classify,x uri, andx urlrecognizex://article/<id>andhttps://x.com/i/article/<id>. A bare numericx get <id>remains a tweet lookup.For non-owner sessions, Article-by-ID resolution uses exact signed-in URL search to find a post containing the Article, checks the embedded Article ID, and retrieves that post through
TweetDetailfor the full body. It rechecks the Article ID before returning it. This is not a direct Article entity API: no search hit means no discoverable linking post, not proof that an Article doesn't exist. Explicit guest/public tiers do not escalate to session access.Closes #56
Verification
go test -race -count=1 ./...;go vet ./...;git diff --check2103118352554344448using the Article URL and bare Article ID; Article URL viax get; classification, fields, and graph. The response included title, full body, author, linking post, cover, and eight inline media entries.