Commit Graph
138 Commits
Author SHA1 Message Date
cc-vpsandChristian Catalan 316cdf77be feat: support rich content in long-form tweets (X Articles)
Add support for extracting rich content from X's long-form tweets,
including embedded code snippets, markdown blocks, quoted tweets,
and other structured content that was previously lost.

Changes:
- Add fieldToggles with withArticleRichContentState to TweetDetail API request
- Implement Draft.js content_state parser (renderContentState) that converts
  blocks and entities to readable markdown format
- Add content_state type definition to GraphqlTweetResult

Supported content:
- Block types: paragraphs, headers, ordered/unordered lists, blockquotes
- Entity types: MARKDOWN (code blocks), DIVIDER, TWEET, LINK, IMAGE

No impact on regular tweets - rich content only adds payload when present.

Includes 20 unit tests for the parser and an opt-in live smoke test.

Co-authored-by: Christian Catalan <[email protected]>
2026-01-12 05:12:33 +00:00
Peter Steinberger e0b960db1a fix: repair search and user-tweets requests 2026-01-12 05:09:28 +00:00
Peter Steinberger d5a527d5fb refactor: unify pagination helpers 2026-01-12 02:58:00 +00:00
Peter Steinberger 16f21800b5 refactor: align replies/thread pagination (#35) (thanks @crcatala) 2026-01-12 02:41:08 +00:00
cc-vpsandChristian Catalan 90037ce880 feat: add pagination support for thread and replies commands
Add --all, --max-pages, --delay, and --cursor options to both thread
and replies commands, enabling fetching of all conversation content
with rate-limit-friendly pagination.

Changes:
- Modified fetchTweetDetail() to accept optional cursor parameter
- Added getRepliesPaged() and getThreadPaged() methods with pagination loop
- Updated CLI commands with new options (--all, --max-pages, --delay, --cursor)
- Added TweetDetailPaginationOptions interface
- JSON output includes nextCursor for scripting/resumption

Options:
- --all: Fetch all pages (no hard limit)
- --max-pages <n>: Limit number of pages when using --all
- --delay <ms>: Delay between page fetches (default: 1000ms)
- --cursor <string>: Resume from a previous cursor

Follows patterns established by bookmarks command and PR #34 (user-tweets).

Co-authored-by: Christian Catalan <[email protected]>
2026-01-12 02:35:36 +00:00
Peter Steinberger c7acdbd3fd fix: restore build:dist and gate in CI 2026-01-12 02:16:37 +00:00
Peter Steinberger 436d4dfb89 refactor: centralize paged tweet printing 2026-01-12 02:09:47 +00:00
Peter Steinberger 5c0d5d1068 refactor: dedupe REST user parsing 2026-01-12 02:09:42 +00:00
Peter Steinberger 0536006012 refactor: extract user lookup mixin 2026-01-12 02:09:37 +00:00
Peter Steinberger 4eac0927c1 fix: paginate user-tweets by --count 2026-01-12 01:35:00 +00:00
cc-vpsandChristian Catalan df98e827f6 feat: add user-tweets command to fetch tweets from a user's profile
Adds new CLI command to fetch tweets from any user's profile timeline.

Usage:
  bird user-tweets @username [-n count] [--pages N] [--json]

Features:
- GraphQL UserByScreenName for username → userId resolution
- Cursor-based pagination with configurable delay (rate-limit safe)
- Hard cap of 10 pages to prevent abuse
- Input validation via normalizeHandle()

Includes 17 unit tests and live smoke test.

Co-authored-by: Christian Catalan <[email protected]>
2026-01-12 01:28:04 +00:00
Peter Steinberger 15aa24d2b1 fix: honor output flags in text rendering 2026-01-11 23:35:03 +00:00
George ZhangandClaude Opus 4.5 a48aa6db88 fix: remove duplicate title field in GraphqlTweetResult article type
The article type had title defined twice (at lines 83 and 135), causing
TypeScript compilation to fail with TS2300: Duplicate identifier 'title'.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
2026-01-11 23:35:03 +00:00
George ZhangandClaude Opus 4.5 d40c048333 fix: improve article detection and quote tweet display
- Use startsWith check instead of fragile length heuristic for
  detecting full article body vs preview mode
- Add media display for quote tweets (🖼️/🎬/🔄 indicators)
- Add preview_text to GraphqlTweetResult type definition to avoid
  type assertions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
2026-01-11 23:35:03 +00:00
George Zhang cf78fce646 feat: improve text output with article preview, quote tweets, and media
Enhance the text output format to show more useful information:

- Article tweets: Show 📰 indicator with title + preview text in feeds,
  full body when reading single tweets
- Quote tweets: Display quoted content with ┌─ QT @user formatting
- Media: Show 🖼️/🎬/🔄 indicators with URLs for photos/videos/GIFs

Also refactors single tweet read to use shared printTweets function
for consistent formatting.
2026-01-11 23:35:03 +00:00
Peter Steinberger 94773c66dc fix: harden home timeline pagination (#31) (thanks @odysseus0) 2026-01-11 11:36:59 +00:00
George ZhangandClaude Opus 4.5 92742cac38 refactor: rename --latest to --following for clarity
Matches Twitter's UI terminology ("For You" vs "Following" tabs),
making the flag immediately understandable to users.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
2026-01-11 11:35:57 +00:00
George ZhangandClaude Opus 4.5 5bb9e48252 refactor: move home query ID methods to mixin as private
Follow the pattern from twitter-client-timelines.ts where query ID
methods are private to the mixin that uses them, rather than protected
in the base class.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
2026-01-11 11:35:57 +00:00
George Zhang ba7b00eb29 feat: add home timeline command
Add `bird home` command to fetch the authenticated user's home timeline.

- Supports "For You" feed (default) and "Following" feed (--latest)
- Uses HomeTimeline and HomeLatestTimeline GraphQL operations
- Includes count option (-n), JSON output, and pagination

Usage:
  bird home           # Get "For You" feed
  bird home --latest  # Get "Following" (chronological) feed
  bird home -n 50     # Fetch 50 tweets
2026-01-11 11:35:57 +00:00
Peter Steinberger 6cf177f92f fix: list timeline pagination (#30) (thanks @zheli) 2026-01-11 11:27:46 +00:00
Zhe LiandClaude Sonnet 4.5 ebcd1618f9 feat: make --max-pages imply --all for list-timeline
- Remove requirement for --max-pages to be used with --all
- Update help text to clarify --max-pages implies --all
- Add list-timeline documentation to README with examples

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
2026-01-11 11:17:27 +00:00
Zhe Li 8fc208ca31 Apply suggestions from code review 2026-01-11 11:17:27 +00:00
Zhe LiandClaude Sonnet 4.5 803bd25b0c feat: add pagination support to list-timeline command
Adds --all, --max-pages, and --cursor options to list-timeline command, enabling users to fetch all tweets from a list through automatic pagination. Follows the same pattern as bookmarks pagination for consistency.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
2026-01-11 11:17:27 +00:00
Peter Steinberger 0a4699711f fix: sanitize hyperlink OSC output (#29) (thanks @mafulafunk) 2026-01-11 11:11:21 +00:00
Martin FunkandClaude Opus 4.5 837b09fcad feat: add clickable hyperlinks for URLs in terminal output
Use OSC 8 escape sequences to make tweet and list URLs clickable
in supported terminals (iTerm2, Ghostty, Kitty, WezTerm, VS Code, etc.).

- Add hyperlink() helper function in output.ts
- Apply hyperlinks in printTweets() for tweet URLs
- Apply hyperlinks in printLists() for list URLs
- Add hyperlinks flag to OutputConfig (auto-disabled for non-TTY)
- Automatically falls back to plain text in --plain mode or when piped

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
2026-01-11 11:10:34 +00:00
Peter Steinberger 092be1a782 fix: harden follow pagination output (#28) (thanks @malpern) 2026-01-11 11:02:09 +00:00
Micah AlpernandClaude Opus 4.5 39a477265c feat: add cursor-based pagination for following/followers commands
Add pagination support to `bird following` and `bird followers` commands,
similar to existing pagination in search/bookmarks/likes.

Changes:
- Add `cursor` parameter to `getFollowing()` and `getFollowers()` client methods
- Return `nextCursor` in `FollowingResult` for pagination continuation
- Add `--cursor <cursor>` CLI option for manual pagination
- Add `--all` CLI flag to automatically fetch all pages
- Add `--max-pages <number>` option to limit pages when using --all
- Add input validation for --max-pages (requires --all or --cursor)
- Add deduplication using Set to prevent duplicate users
- Add 1-second delay between pages to avoid overwhelming the API
- Update `-n/--count` description to clarify it's per-page
- Add unit tests for cursor parameter and nextCursor response

Usage examples:
  # Fetch first page (default 20 users)
  bird following

  # Fetch with specific page size
  bird following -n 50

  # Use cursor for next page
  bird following --cursor "CURSOR_FROM_PREVIOUS"

  # Fetch ALL following users automatically (with rate limiting)
  bird following --all --json

  # Limit to first 5 pages
  bird following --all --max-pages 5

  # Same options work for followers
  bird followers --all

Note: REST API fallback does not support cursor pagination.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
2026-01-11 10:59:35 +00:00
Zhe Li 892fe25970 Update src/lib/twitter-client-features.ts 2026-01-11 10:42:17 +00:00
Zhe Li d1de42e91b fix: add required lists API features 2026-01-11 10:42:17 +00:00
Zhe LiandClaude Sonnet 4.5 ec09010122 fix: add required API features to buildListsFeatures
X/Twitter now requires vibe_api_enabled, responsive_web_text_conversations_enabled, tweetypie_unmention_optimization_enabled, and interactive_text_enabled to be explicitly set in lists API requests.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
2026-01-11 10:42:17 +00:00
Peter Steinberger 2e03bd8c07 fix: paginate likes + avoid duplicate loops (#12) (thanks @titouv) 2026-01-11 10:31:47 +00:00
Titouan V 7548fd5ed1 paginate bookmarks and folders 2026-01-11 10:29:58 +00:00
Philipp Spiess f08c94e2a8 fix: add post_ctas_fetch_enabled feature flag
Twitter API now requires this flag, otherwise returns HTTP 400.
2026-01-08 16:14:51 +01:00
Peter Steinberger 6fbbaebb68 fix: improve unbookmark url handling 2026-01-05 03:51:56 +01:00
Mariano Belinky 04a0c98362 feat: add unbookmark command to remove bookmarks 2026-01-05 02:10:10 +00:00
Peter Steinberger f5402f2b43 feat: add runtime feature overrides 2026-01-05 01:23:32 +01:00
Pedro Pinera Buendia a3eb372494 fix: add responsive_web_grok_annotations_enabled to all feature sets
X/Twitter now requires this feature flag in API requests.
Without it, requests fail with HTTP 400:
'The following features cannot be null: responsive_web_grok_annotations_enabled'

Fixes #24
2026-01-05 00:07:01 +00:00
Peter Steinberger a3e2dccc46 fix: restore tweet lookup in instructions 2026-01-04 23:42:34 +00:00
Peter Steinberger f765955116 fix: stabilize bookmark pagination cursors 2026-01-04 23:42:34 +00:00
Leon Ho 3442ba84c6 feat: add cursor-based pagination to bookmarks command
- Add --cursor option to resume pagination from a specific point
- Change --max-pages to enable pagination independently
- Return nextCursor in JSON output for subsequent requests

feat: add cursor param and nextCursor to pagination methods

not modifying max-pages
2026-01-04 23:42:34 +00:00
Peter Steinberger c4fa04e0b2 feat: include raw tweet data in mapping 2026-01-05 00:30:01 +01:00
Peter Steinberger b83d065907 fix: restore list types and tidy tests 2026-01-03 18:34:32 +01:00
Peter Steinberger d8643ae1d1 fix: improve media extraction 2026-01-03 18:34:32 +01:00
Nikita 067c98c245 feat: add media extraction support for photos, videos, and GIFs 2026-01-03 18:34:32 +01:00
Peter Steinberger e537e102e3 fix: normalize list privacy parsing 2026-01-03 16:55:29 +01:00
Harper ReedandClaude Opus 4.5 59e827e153 test(lists): improve test coverage and extract list ID parsing
- Extract extractListId to src/lib/extract-list-id.ts with proper tests
- Add json-full/includeRaw test for list timeline
- Add 404 retry tests for getOwnedLists and getListMemberships
- Add tests for skipping invalid list entries and missing owner handling
- Use shared TwitterClientPrivate type from fixtures

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
2026-01-03 16:55:29 +01:00
Harper ReedandClaude Opus 4.5 7818440d65 feat(lists): add support for Twitter Lists
Add commands to fetch owned lists, list memberships, and list timelines:
- `bird lists` shows lists you own
- `bird lists --member-of` shows lists you're a member of
- `bird list-timeline <id-or-url>` fetches tweets from a list

Includes full --json and --json-full support for list timeline output.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
2026-01-03 16:55:29 +01:00
Peter Steinberger 3db3aca0a0 style: lint fixes 2026-01-03 15:51:49 +01:00
Peter Steinberger b27643edbb fix: harden bookmark retry handling 2026-01-03 15:51:49 +01:00
Haoli 56ca7b9841 Add paged bookmark export with gating and retries 2026-01-03 15:51:49 +01:00