This project is a modular Node.js application that uses cron jobs to manage multiple automated tasks and includes a Telegram bot service:
-
Active Subscription Updater:
Reads active subscriptions from theuser-datacollection and updates theinfluencer-datacollection with the current list of active subscribers for each Twitter handle. -
Tweets Processing Job:
Scrapes new tweets for each Twitter handle (influencer), filters them for actionable trading signals using the OpenAI API, and stores new tweets in theinfluencer-datacollection. Duplicate processing is prevented via a persistentprocessedTweetIdsarray. -
Telegram Bot Listener:
Continuously listens for incoming messages on the configured Telegram bot and automatically sends welcome messages to new users. The service tracks welcomed users in the database to prevent duplicate messages.
Make sure to set the following environment variables in your .env file:
TELEGRAM_BOT_TOKEN- Your Telegram Bot API tokenMONGODB_URI- Your MongoDB connection stringOPENAI_API_KEY- Your OpenAI API keyPERPLEXITY_API_KEY- Your Perplexity API keyTWEETSCOUT_API_KEY- Your TweetScout API key