Use node version 18> or install node-fetch.
Create .env file with WEBSOCKET_URL (starting with wss://) variable. You could use free version of quicknode.com for Base endpoint provider. Also add Twitter API token to .env file as TWITTER_TOKEN. Free API version should be enough.
npm install
node index.js
Find it useful? Buy my shares: https://www.friend.tech/rooms/0x3a2e3fe0b9a67e894f1c5ecb7b5ba15cd7e7f15e