How themessimagic/ytnews works
AI News Portal monitors a YouTube channel, extracts a new video's transcript, generates and parses a structured article, then stores it for the Flask site to publish. The site also tracks page visits in PostgreSQL and exposes protected analytics. The workflow and integrations are documented or visible in the sampled app.py and watcher.py; templates and deployment automation are represented only where the README documents their role.
Main entry points: watcher.py Channel watcher · app.py Flask web app · analytics.html Analytics dashboard · articles Article JSON files
Components 19
Article generation
- Channel watcher
watcher.py - YouTube Data API
- Apify transcript scraper
- Video transcript
- Gemini article writer
- Article parser
watcher.py - Last-video state
state.json
Article publishing
- Article JSON files
articles - Flask web app
app.py - Article templates
templates/article.html - News index
templates/index.html
Traffic analytics
- Visit tracking
app.py - Analytics database
- Analytics API
app.py
Administration
- Admin pages
templates/admin_login.html - Analytics dashboard
templates/analytics.html - Admin authentication
app.py
Other components
- YouTube channel
- Site visitor
Connections 24
- YouTube channel → YouTube Data API: uploads videos
README.md - Channel watcher → YouTube Data API: checks uploads
watcher.py - YouTube Data API → Channel watcher: returns video details
watcher.py - Channel watcher → Apify transcript scraper: requests transcript
watcher.py - Apify transcript scraper → Channel watcher: returns segments
watcher.py - Channel watcher → Video transcript: joins segments
watcher.py - Channel watcher → Gemini article writer: generates article
watcher.py - Gemini article writer → Channel watcher: returns article text
watcher.py - Channel watcher → Article parser: parses response
watcher.py - Channel watcher → YouTube Data API: fetches metadata
watcher.py - Channel watcher → Article JSON files: writes JSON
watcher.py - Channel watcher → Last-video state: reads and updates
watcher.py - Site visitor → Flask web app: requests pages
README.md - Flask web app → Article JSON files: loads articles
app.py - Flask web app → News index: renders index
README.md - Flask web app → Article templates: renders article
README.md - Flask web app → Admin pages: renders login
README.md - Flask web app → Admin authentication: checks admin access
app.py - Admin authentication → Analytics dashboard: serves dashboard
app.py - Flask web app → Visit tracking: tracks page views
app.py - Visit tracking → Analytics database: writes visits
app.py - Flask web app → Analytics API: serves reports
app.py - Analytics API → Analytics database: queries metrics
app.py - Analytics dashboard → Analytics API: requests metrics
app.py