Skip to content

aila-danish/Radius

Repository files navigation

Radius — News Diversity Dashboard & Cognitive Analysis Layer

A Chrome extension (Manifest V3) that tracks your news reading habits and provides real-time epistemic transparency. Radius scores your news diet across political leaning, outlet type, topic breadth, and source concentration — then helps you break out of filter bubbles.

Features

Dashboard (New Tab Override)

  • Diversity Score — 0–100 composite score across four dimensions
  • Concentric Ring Visualization — political spread, outlet variety, topic breadth, source concentration
  • Political Lean Spectrum — 7-point scale with left/centre/right breakdown
  • Gemini-Powered Recommendations — personalized article suggestions that challenge your reading pattern
  • Beyond the Radius — blindspot detection showing what perspectives you're missing
  • Algorithm Exposure Transparency — tracks how content reaches you (algorithmic vs. direct search vs. shared)
  • Reinforcement Velocity — detects whether algorithmic filtering is tightening over time
  • Light/Dark Mode

Article Overlay (Content Script)

Activates on news articles and provides real-time analysis:

  • Multi-Axis Ideology — Economic, Social, Institutional Trust, Globalism (radar chart)
  • Framing & Emotional Bias — tone detection, certainty language, moral foundations
  • Evidence Quality — source counting, argument strength, speculation density
  • Rhetorical Device Detection — loaded language, appeal to fear, false dichotomy, etc.
  • Missing Context Detection — flags potential gaps in historical, economic, or opposing perspectives
  • Narrative Comparison — Gemini-powered cross-outlet article discovery
  • AI Content Detection — heuristic likelihood scoring
  • Reflective Prompts — cognitive tools to encourage critical thinking

Popup

  • Quick-glance diversity score and rings
  • Political lean mini-spectrum
  • Algorithm exposure indicator
  • Top outlets this week

Installation

From Source (Developer Mode)

  1. Clone this repository
  2. Open chrome://extensions/
  3. Enable Developer mode (top right)
  4. Click Load unpacked
  5. Select the repository folder
  6. Open a new tab to see your dashboard

From ZIP

  1. Download Radius-Extension.zip
  2. Extract to a folder
  3. Follow steps 2–6 above

Architecture

Radius/
├── manifest.json          # Manifest V3 configuration
├── background.js          # Service worker — visit tracking, exposure logging
├── outlets.js             # Database of 35 news outlets with classifications
├── scoring.js             # Diversity scoring algorithm (4 dimensions)
├── exposure.js            # Algorithm exposure transparency module
├── gemini.js              # Gemini API integration (recommendations, comparison)
├── theme-init.js          # Theme detection (CSP-compliant)
├── newtab.html/js/css     # Dashboard UI
├── popup.html/js/css      # Extension popup UI
├── content/               # Article overlay system
│   ├── lexicon.js         # Keyword dictionaries & pattern databases
│   ├── parser.js          # Article detection & text extraction
│   ├── analyzer.js        # NLP analysis engine
│   ├── overlay.js         # Floating panel UI renderer
│   ├── overlay.css        # Overlay styles (namespaced)
│   └── content.js         # Entry point controller
└── icons/                 # Extension icons

Tech Stack

  • Vanilla JavaScript — no frameworks, no build step
  • ES Modules — for extension pages and service worker
  • Chrome Storage API — all data stored locally
  • Gemini 2.0 Flash — personalized recommendations with Google Search grounding
  • SVG — all charts and visualizations rendered client-side

Privacy

  • All browsing data stays local in chrome.storage.local
  • Only recognized news outlet visits are tracked (35 outlets)
  • No browsing data is sent to any server
  • Gemini API calls send only aggregated reading patterns (topics, leanings), never URLs or article content
  • No analytics, no telemetry

Scoring Methodology

Dimension What It Measures How
Political Spread Range of ideological positions Standard deviation of leaning values
Outlet Variety Diversity of outlet types Weighted count across 5 categories
Topic Breadth Coverage of subject areas Weighted count across 7 categories
Source Concentration Over-reliance on single outlets Inverse HHI (Herfindahl–Hirschman Index)

Configuration

Radius uses the Gemini 2.0 Flash API for personalised recommendations and narrative comparison. To enable these features:

  1. Get a free API key from Google AI Studio
  2. Open gemini.js
  3. Replace YOUR_GEMINI_API_KEY_HERE with your key

The extension works without a key — the dashboard, scoring, overlay analysis, and all other features run fully offline. Only the "Recommended Reading" and "Compare Coverage" features require the API.

License

MIT

About

Chrome extension that tracks your news diet diversity, scores reading habits across political lean, outlet type, and topic breadth, and provides real-time article analysis with an on-page overlay.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors