Python project for collecting tweets, selecting top-performing posts, extracting tone/style patterns with LLM, and generating draft posts.
- Scrapes tweets from configured accounts (
TwitterAPI.ioprovider). - Stores data in PostgreSQL.
- Selects top tweets by configurable percentile and date window.
- Extracts repeatable writing patterns (hooks, structure, vocabulary).
- Generates post drafts based on the extracted tone guide.
- Includes a Streamlit UI for manual pipeline runs and monitoring.
- Python 3.11+
- PostgreSQL
- Streamlit
- OpenAI/OpenRouter/Anthropic (at least one provider for LLM stages)
git clone <your-public-repo-url>
cd AI-Twitter-Tracker
cp .env.example .env
# Fill your credentials in .env
pip install -r requirements.txt
python scripts/migrate.py
# Optional smoke test
python src/twitter_scraper.py --accounts="sample_account_1" --max-tweets=20 --dry-run
# Run UI
streamlit run streamlit_app.py --server.address=127.0.0.1 --server.port=8501# Scrape tweets
python src/twitter_scraper.py --accounts="sample_account_1,sample_account_3" --max-tweets=100
# Select top tweets
python src/select_top_tweets.py --hours-back=24 --top-percentile=20
# Analyze patterns
python src/analyze_patterns.py --top-tweets-limit=50
# Generate posts
python src/generate_posts.py --count=20src/ # Pipeline scripts and shared utils
scripts/ # Setup/migration/bootstrap scripts
tests/ # Unit + E2E tests
streamlit_app.py # Dashboard UI
.env.example # Config template
pytest tests/ -v.envis intentionally excluded from git.- This public version excludes internal docs and local workspace artifacts.