Media vs Ground Reality — Compares what mainstream media reports against what real people are saying across YouTube, Telegram, Twitter/X, and Google Trends.
Analyzes Tamil Nadu politics by default, but supports India national, US, UK, France, and global topics.
- You enter a topic (e.g. "DMK", "AIADMK", "2026 Tamil Nadu election")
- The app fetches YouTube comments, Telegram channel posts, tweets, and Google Trends data
- Claude (Anthropic) fuses all sources and returns a structured Gap Score
| Score | Meaning |
|---|---|
| Media Score | What mainstream media is saying (0–100) |
| People Score | What real people are saying (0–100) |
| Gap Score | Divergence between the two (0–100) |
| Verdict | MAJOR GAP / MODERATE GAP / ALIGNED / REVERSE GAP |
| Layer | Technology |
|---|---|
| Frontend | Plain HTML/CSS/JS (no framework) |
| Backend | Python · Flask |
| AI Analysis | Claude claude-sonnet-4-5 via Anthropic API |
| Social Data | YouTube Data API v3 |
| Messaging | Telegram via Telethon |
| Trends | Google Trends via pytrends |
| Nitter public instances (no API key needed) |
- Python 3.9+
- Anthropic API key → console.anthropic.com
- YouTube Data API v3 key → Google Cloud Console
- Telegram account + API credentials → my.telegram.org
git clone https://github.com/Mugeshgithub/deep-intelligence.git
cd deep-intelligencepip install -r requirements.txtCreate a .env file in the project root:
TELEGRAM_API_ID=your_api_id
TELEGRAM_API_HASH=your_api_hash
TELEGRAM_SESSION= # leave blank for now — filled by setup_telegram.pyGet your TELEGRAM_API_ID and TELEGRAM_API_HASH from my.telegram.org → API Development Tools.
python3 setup_telegram.py +919XXXXXXXXXWhen prompted, Telegram sends an OTP to your app. Write the code to a temp file:
echo "12345" > .tg_codeIf you have 2FA enabled, also write your password:
echo "yourpassword" > .tg_pwdOn success, TELEGRAM_SESSION is automatically saved to your .env.
Open deep-intelligence.html and set your keys at the top of the <script> block:
const ANTHROPIC_API_KEY = 'sk-ant-...';
const YOUTUBE_API_KEY = 'AIza...';python3 server.pyServer starts at http://localhost:5001
Visit http://localhost:5001 in your browser.
| Endpoint | Params | Description |
|---|---|---|
GET /api/telegram |
topic, region |
Fetch posts from Telegram media/party channels |
GET /api/trends |
topic, geo, compare |
Google Trends interest over time |
GET /api/twitter |
topic, lang, limit |
Tweets scraped via Nitter |
GET /api/status |
— | Telegram config status and loaded regions |
| Code | Region |
|---|---|
IN-TN |
Tamil Nadu (default) |
IN |
India National |
US |
United States |
UK |
United Kingdom |
FR |
France |
GLOBAL |
Global fallback |
- YouTube comments — Many Tamil political channels disable comments. The app falls back to video titles as signal.
- Twitter/X — Uses free Nitter scrapers which may go offline. No official API key needed.
- YouTube quota — Free tier is 10,000 units/day on Google Cloud.
- Tamil NLP — Claude translates Tamil/Tanglish comments but is not a specialized Tamil NLP model.
- WhatsApp — Cannot be accessed programmatically (private platform).
deep-intelligence/
├── server.py # Flask backend (port 5001)
├── deep-intelligence.html # Main app UI
├── cognivex-dashboard.html # Dashboard view
├── ground-reality-FINAL (1).html
├── setup_telegram.py # Telegram one-time auth
├── requirements.txt
├── PROMPTS.md # Claude prompt documentation
└── .env # Your credentials (never commit this)
CognivexAI · Ground Reality Intelligence