Skip to content

fix: twitter search adapter broken by X platform changes#30

Merged
nashsu merged 1 commit intonashsu:mainfrom
danielctc:fix/twitter-search-adapter
Apr 8, 2026
Merged

fix: twitter search adapter broken by X platform changes#30
nashsu merged 1 commit intonashsu:mainfrom
danielctc:fix/twitter-search-adapter

Conversation

@danielctc
Copy link
Copy Markdown

Summary

  • The intercept strategy with history.pushState no longer triggers X's client-side router, causing search to return empty results every time
  • Switched to cookie strategy with DOM scraping, consistent with the working trending and timeline adapters
  • Added retweets and replies columns to search output

What changed

  • strategy: interceptstrategy: cookie
  • Removed the pushState/popstate navigation hack and XHR interception pipeline
  • Navigate directly to search URL, wait for render, then extract tweets from article[data-testid="tweet"] elements
  • Parse engagement metrics from DOM buttons (like, retweet, reply testIds)

Tested

  • Verified working on macOS (aarch64) with Chrome extension connected
  • Returns correct results with author, text, likes, retweets, replies, views, and URLs

Relates to nashsu/autocli-skill#1

The intercept strategy with history.pushState no longer triggers X's
client-side router, resulting in empty search results every time.

Switch to cookie strategy with DOM scraping, matching the approach
used by the working trending and timeline adapters. Also adds
retweets and replies columns.

Fixes nashsu/autocli-skill#1
Copy link
Copy Markdown
Owner

@nashsu nashsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for your contribution.

@nashsu nashsu merged commit d63e052 into nashsu:main Apr 8, 2026
@linxiang-dev
Copy link
Copy Markdown

looking forward to the new release

@danielctc
Copy link
Copy Markdown
Author

Glad to have helped! hopefully it works for all.

@nashsu
Copy link
Copy Markdown
Owner

nashsu commented Apr 9, 2026

released!

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.

3 participants