PoliTalk is a browser extension that analyzes short-form videos for political bias in near real-time. It records the currently playing video on supported platforms, transcribes speech, estimates a bias score, and surfaces related news links for context.
Project page: Devpost submission
- Detects active videos on TikTok, Instagram, and YouTube.
- Captures a short recording from the visible playing video.
- Sends the clip to a local backend for analysis.
- Transcribes speech using ElevenLabs Speech-to-Text.
- Scores political bias (1-10) and labels direction/strength via Gemini.
- Shows key terms, transcript text, and related news articles in an on-page UI.
Frontend/- Chrome extension (Vite + React + TypeScript + Tailwind).Backend/- Express API that handles upload, transcription, and AI analysis.README.md- Project documentation (this file).
- Node.js 18+ (recommended: latest LTS)
- npm
- Google Gemini API key
- ElevenLabs API key
- Chrome (or Chromium-based browser) for loading the extension
Create a .env file in Backend/:
GEMINI_API_KEY=your_gemini_api_key
ELEVENLABS_API_KEY=your_elevenlabs_api_keyNotes:
GEMINI_API_KEYis required for bias analysis.ELEVENLABS_API_KEYis required for transcription.
Install backend dependencies:
cd Backend
npm installInstall frontend dependencies:
cd Frontend
npm installFrom Backend/:
npm run devBackend runs on http://localhost:3000.
From Frontend/:
npm run buildThis outputs the extension bundle in Frontend/dist/.
- Open
chrome://extensions - Enable Developer mode
- Click Load unpacked
- Select
Frontend/dist
- Make sure the backend is running.
- Open TikTok, Instagram, or YouTube.
- Play a video.
- PoliTalk injects a panel in the page and starts analysis automatically.
- Review:
- Bias spectrum and label
- Key terms
- Transcript
- Related news links (if available)
Accepts multipart form-data with:
video(file, expected as webm from the extension recorder)
Returns JSON including:
bias_scorebias_labelkey_termstranscriptionrelated_articles
- Frontend: React, TypeScript, Vite, Tailwind, Radix UI
- Extension: Manifest V3 content script + injected UI
- Backend: Node.js, Express, Multer, Axios
- AI Services: ElevenLabs STT + Google Gemini
Failed to fetchin the extension UI:- Confirm backend is running on
http://localhost:3000
- Confirm backend is running on
- Analysis errors:
- Verify both API keys are set in
Backend/.env - Restart backend after changing env vars
- Verify both API keys are set in
- No results on page:
- Ensure you are on a supported domain with an actively playing video
- Rebuild and reload the extension after frontend changes
Backend (Backend/package.json):
npm run start- run backend with Nodenpm run dev- run backend with nodemon
Frontend (Frontend/package.json):
npm run dev- run Vite dev servernpm run build- build extension assetsnpm run preview- preview built frontendnpm run lint- run ESLint