This service monitors ConsortiumNews, ProPublica, and Truthout for new articles, generates AI summaries, and posts them to a Telegram channel. Now includes enhanced bot commands for monitoring and control.
🚀 New User? Check out the Quick Start Guide for a 5-minute setup!
- Automated News Monitoring: Continuously monitors multiple news sources
- AI-Powered Summaries: Generates concise summaries using Google's Gemini AI
- Enhanced Bot Commands: Full control and monitoring via Telegram commands
- Comprehensive Logging: Detailed activity, error, and performance logs
- Remote Management: Start, stop, and restart processes remotely
/log <type>- Download various log files as .txt documents/status- Show bot and process status with uptime and memory usage/rerun- Restart the entire news aggregation process/stop- Completely shut down the bot and all processes/help- Show all available commands
activity- Full activity log (debug.log)errors- Error messages (errors.log)articles- Published articles log (new_articles.log)fetch- Article fetch monitoringparse- Article parsing monitoringai- AI processing monitoringtelegram- Telegram message delivery monitoringmemory- Memory usage monitoringperformance- Performance metrics
/log activity # Download full activity log
/log errors # Download error log
/log articles # Download published articles log
/status # Check system status
/rerun # Restart if something is stuck
/stop # Emergency shutdown
- Configure your environment:
# Required environment variables in .env
TELEGRAM_BOT_TOKEN=your_bot_token_from_botfather
TELEGRAM_CHAT_ID=your_chat_or_channel_id
GOOGLE_API_KEY=your_google_ai_api_key- Install dependencies:
npm install- Start the enhanced bot with news aggregation:
npm start # Full service with bot commands (recommended)Or choose a specific mode:
npm run bot # Bot commands only (no automatic news checking)
npm run original # Original main.js behavior
npm run test # Test Telegram connectivitynpm start- Starts enhanced bot with all commands
- Runs news aggregation every 30 minutes
- Full monitoring and logging
- Remote control via Telegram commands
npm run bot- Only starts bot for manual control
- Use
/reruncommand to trigger news aggregation - Perfect for testing or manual operation
npm run original- Runs original main.js once and exits
- No bot commands or continuous monitoring
The enhanced system provides comprehensive logging:
debug.log- Full activity logerrors.log- Error messages onlynew_articles.log- Published articlesterminal.log- General application logs
fetch_monitor.log- Article fetching attemptsparse_monitor.log- HTML parsing resultsai_monitor.log- AI processing statustelegram_monitor.log- Message delivery statusmemory_monitor.log- Memory usage trackingperformance_monitor.log- Performance metrics
Use /log <type> command to download any log file instantly to your Telegram chat.
- Never commit the
.envfile to version control - Keep your API keys secret and secure
- Regularly rotate your API keys
- Monitor your API usage to prevent unauthorized access
- Bot commands are restricted to the configured TELEGRAM_CHAT_ID only
The project uses environment variables for all sensitive configuration. When developing:
- Always use
config.jsto access environment variables - Never hardcode API keys or tokens
- Use the
.gitignorefile to prevent committing sensitive files - Test with
npm run testbefore deployment
├── enhanced_main.js # Enhanced main script with bot integration
├── bot_controller.js # Telegram bot command handler
├── bot_launcher.js # Standalone bot launcher
├── main.js # Original main script
├── sender.js # Telegram message sender
├── ProPublica/ # ProPublica news source
├── consortiumnews/ # ConsortiumNews source
├── utils/ # Utility modules
│ ├── config.js # Environment configuration
│ ├── logger.js # Logging utilities
│ ├── monitoring.js # Enhanced monitoring
│ └── ...
└── logs/ # Log files
└── monitor/ # Enhanced monitoring logs
The enhanced bot supports full process lifecycle management:
- Start: Automatically starts news aggregation
- Monitor: Real-time status via
/statuscommand - Restart: Use
/rerunto restart stuck processes - Stop: Graceful shutdown with
/stopcommand - Logs: Instant access to all logs via
/logcommands
- Check bot token in
.envfile - Verify chat ID is correct
- Use
/statusto check if process is running - Try
/rerunto restart
/log help # See available log types
/log activity # Download main activity log/status # Check process status
/rerun # Restart news aggregation/stop # Complete shutdown