Skip to content

docs(examples): repair tweet stream with Xquik - #5543

Open
kriptoburak wants to merge 1 commit into
socketio:mainfrom
kriptoburak:codex/repair-xquik-tweet-stream
Open

docs(examples): repair tweet stream with Xquik#5543
kriptoburak wants to merge 1 commit into
socketio:mainfrom
kriptoburak:codex/repair-xquik-tweet-stream

Conversation

@kriptoburak

Copy link
Copy Markdown

Problem

The maintained examples/tweet-stream example calls Twitter's retired v1.1 filtered-stream endpoint through node-tweet-stream. X documents retired v1 endpoints as inactive and returning 410.

The dependency also requires 4 legacy OAuth secrets. It has not published a release since 2022.

Solution

  • Replace the retired client with the published Xquik tweet-search API.
  • Keep the existing buffer and tweet Socket.IO events.
  • Poll once per minute by default and request only new post IDs.
  • Exclude replies and reposts, deduplicate IDs, and keep 10 buffered posts.
  • Validate response rows before broadcasting their documented public fields.
  • Add setup, configuration, payload-safety, and testing documentation.
  • Remove node-tweet-stream and its legacy transitive dependencies.

The change stays inside the existing tweet-stream example. It uses Node.js 18's built-in fetch and adds no new runtime dependency.

Validation

  • npm test: 8 tests pass.
  • node --check on each JavaScript file: pass.
  • Prettier 3.3.2: all changed files pass.
  • Fresh install: 22 packages, zero reported vulnerabilities.
  • Socket.IO server construction and shutdown smoke test: pass.
  • git diff --check: pass.

No live Xquik request ran because no contributor credential was used. The request contract matches the published Xquik search documentation.

Risk and rollback

The change affects only an example excluded from the root workspaces. Reverting this commit restores the previous example.

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.

1 participant