Fix: Replace dead PubNub Twitter stream with live WebSocket data source#11
Open
Fix: Replace dead PubNub Twitter stream with live WebSocket data source#11
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: undefined
- Twitter/X ended free API access in Feb 2023, breaking PubNub demo stream - Replaced with Quixio's free AI chat WebSocket stream - Removed PubNub SDK dependency, using native WebSocket API - Added automatic reconnection logic (5s delay on disconnect) - Created test utilities in experiments/ folder - Maintains original Matrix visual effect and all features WebSocket: wss://ai-chat-wss-demo-realtimedatasources-prod.deployments.quix.io/timeseries Data source: https://github.com/quixio/real-time-data-sources Fixes #8 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Open
This reverts commit ad6b05a.
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.
🔧 Fix: Replace Dead PubNub Twitter Stream with Live WebSocket Data
📋 Issue Reference
Fixes #8
🔍 Problem Analysis
The application stopped working because the PubNub Twitter stream (
pubnub-twitterchannel) is no longer functional. This is due to:index.htmlandmessages.htmlwere unable to receive real-time data, rendering the matrix visualization non-functional✅ Solution Implemented
Replaced the deprecated PubNub Twitter stream with a free, actively maintained WebSocket stream from Quixio's real-time-data-sources:
WebSocket URL:
wss://ai-chat-wss-demo-realtimedatasources-prod.deployments.quix.io/timeseriesData Source: Real-time AI-generated customer support chat conversations (using Llama2 AI agents)
📝 Changes Made
1. index.html
PUBNUB.init()with native WebSocket API2. messages.html
PUBNUB.init()with native WebSocket APItwitterMessagestochatMessages🎯 Benefits
🧪 Testing
Created test utilities in
experiments/folder:test_websocket.html- Simple WebSocket connection testtest_server.py- Local HTTP server for testingTo test locally:
📊 Technical Details
WebSocket Message Format:
{ "timestamps": [1234567890], "stringValues": { "chat": ["Customer message text here"], "conversation_id": ["conv_123"], "role": ["customer"] } }The implementation extracts
chattext fromstringValuesand converts it to Unicode symbols using the existinggetSymbols()function, maintaining compatibility with the original visualization logic.🚀 Deployment
No special deployment steps required. The changes work with any static file hosting since WebSocket connections are made client-side.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com