An intelligent web application that analyzes X (formerly Twitter) threads for sentiment analysis, bot detection, and engagement metrics.
- Real-time thread monitoring and analysis
- Advanced sentiment analysis using VADER
- Lightweight bot detection
- Engagement-optimized responses
- Web interface for manual analysis
- Historical analysis storage
- Automated engagement strategies
- Python 3.8+
- X Developer Account with API access
- SQLite3
- Clone the repository:
git clone https://github.com/yourusername/XRAT10.git
cd XRAT10- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
cp .env.example .envEdit .env with your X API credentials and other configuration settings.
The following environment variables are required:
X_API_KEY: Your X API KeyX_API_SECRET: Your X API SecretX_ACCESS_TOKEN: Your X Access TokenX_ACCESS_TOKEN_SECRET: Your X Access Token SecretX_BEARER_TOKEN: Your X Bearer TokenCLIENT_ID: Your OAuth 2.0 Client IDCLIENT_SECRET: Your OAuth 2.0 Client SecretSECRET_KEY: A secure secret key for the applicationDEBUG: Set to False in productionDATABASE_URL: Your database URL (default: SQLite)
For development, copy .env.example to .env and fill in your values.
For production deployment (e.g., Vercel), set these in your deployment platform's environment variables.
XRAT10/
├── app/
│ ├── api/
│ │ └── endpoints/
│ ├── core/
│ │ ├── config.py
│ │ └── security.py
│ ├── db/
│ │ └── models.py
│ ├── services/
│ │ ├── sentiment.py
│ │ └── bot_detection.py
│ ├── static/
│ │ ├── css/
│ │ └── js/
│ └── templates/
├── tests/
├── .env.example
├── .gitignore
├── README.md
└── requirements.txt
- Start the application:
uvicorn app.main:app --reload-
Access the web interface at
http://localhost:8000 -
Enter a tweet ID to analyze or wait for mentions to trigger automatic analysis
GET /: Home pagePOST /analyze: Analyze a specific threadGET /past_analyses: View historical analysesGET /api/v1/stats: Get analysis statistics (API)
Follow the installation instructions above.
- Fork/clone this repository
- Import to Vercel
- Set up environment variables in Vercel project settings
- Deploy!
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- VADER Sentiment Analysis
- FastAPI framework
- X API