Skip to content

Real-time dashboard for monitoring global news, markets, and geopolitical events

TypeScript

Add World Leaders panel with 20 key global figures

Reggie89f7e6bf8a08
diff --git a/static/index.html b/static/index.html
index 36bc374..ca6ebc3 100644
--- a/static/index.html
+++ b/static/index.html
@@ -1151,6 +1151,17 @@
</div>
</section>
+ <!-- World Leaders -->
+ <section class="panel wide" data-panel="leaders">
+ <div class="panel-header">
+ <span class="panel-title">World Leaders</span>
+ <span class="panel-count" id="leadersCount">-</span>
+ </div>
+ <div class="panel-content leaders-panel" id="leadersPanel">
+ <div class="loading-msg">Loading...</div>
+ </div>
+ </section>
+
<!-- Intel Feed -->
<section class="panel wide" data-panel="intel">
<div class="panel-header">
diff --git a/static/js/constants.js b/static/js/constants.js
index 8800018..56d568e 100644
--- a/static/js/constants.js
+++ b/static/js/constants.js
@@ -21,6 +21,7 @@ export const PANELS = {
venezuela: { name: 'Venezuela Situation', priority: 2 },
greenland: { name: 'Greenland Situation', priority: 2 },
iran: { name: 'Iran Situation', priority: 2 },
+ leaders: { name: 'World Leaders', priority: 1 },
intel: { name: 'Intel Feed', priority: 2 },
correlation: { name: 'Correlation Engine', priority: 1 },
narrative: { name: 'Narrative Tracker', priority: 1 }
@@ -1141,14 +1142,14 @@ export const PRESETS = {
name: 'Geopolitics Watcher',
icon: '๐ŸŒ',
description: 'Global situation awareness and regional hotspots',
- panels: ['map', 'intel', 'politics', 'gov', 'venezuela', 'greenland', 'iran', 'correlation', 'narrative']
+ panels: ['map', 'intel', 'politics', 'gov', 'leaders', 'venezuela', 'greenland', 'iran', 'correlation', 'narrative']
},
'intel': {
id: 'intel',
name: 'Intelligence Analyst',
icon: '๐Ÿ”',
description: 'Deep analysis, pattern detection, and narrative tracking',
- panels: ['map', 'intel', 'correlation', 'narrative', 'mainchar', 'politics']
+ panels: ['map', 'intel', 'leaders', 'correlation', 'narrative', 'mainchar', 'politics']
},
'minimal': {
id: 'minimal',
@@ -1167,11 +1168,84 @@ export const PRESETS = {
heatmap: true, markets: true, monitors: true, commodities: true,
polymarket: true, whales: true, mainchar: true, printer: true,
contracts: true, ai: true, layoffs: true, venezuela: true,
- greenland: true, iran: true, intel: true, correlation: true, narrative: true
+ greenland: true, iran: true, leaders: true, intel: true, correlation: true, narrative: true
})
}
};
+// World Leaders for tracking
+export const WORLD_LEADERS = [
+ // United States
+ { id: 'trump', name: 'Donald Trump', title: 'President', country: 'United States', flag: '๐Ÿ‡บ๐Ÿ‡ธ',
+ keywords: ['trump', 'potus', 'white house'], since: 'Jan 2025', party: 'Republican',
+ focus: ['tariffs', 'immigration', 'deregulation'] },
+ { id: 'vance', name: 'JD Vance', title: 'Vice President', country: 'United States', flag: '๐Ÿ‡บ๐Ÿ‡ธ',
+ keywords: ['jd vance', 'vice president vance'], since: 'Jan 2025', party: 'Republican' },
+
+ // China
+ { id: 'xi', name: 'Xi Jinping', title: 'President', country: 'China', flag: '๐Ÿ‡จ๐Ÿ‡ณ',
+ keywords: ['xi jinping', 'xi', 'chinese president'], since: 'Mar 2013', party: 'CCP',
+ focus: ['taiwan', 'belt and road', 'tech dominance'] },
+
+ // Russia
+ { id: 'putin', name: 'Vladimir Putin', title: 'President', country: 'Russia', flag: '๐Ÿ‡ท๐Ÿ‡บ',
+ keywords: ['putin', 'kremlin', 'russian president'], since: 'May 2012', party: 'United Russia',
+ focus: ['ukraine war', 'nato expansion', 'energy'] },
+
+ // Europe
+ { id: 'starmer', name: 'Keir Starmer', title: 'Prime Minister', country: 'United Kingdom', flag: '๐Ÿ‡ฌ๐Ÿ‡ง',
+ keywords: ['starmer', 'uk pm', 'british prime minister'], since: 'Jul 2024', party: 'Labour' },
+ { id: 'macron', name: 'Emmanuel Macron', title: 'President', country: 'France', flag: '๐Ÿ‡ซ๐Ÿ‡ท',
+ keywords: ['macron', 'french president', 'elysee'], since: 'May 2017', party: 'Renaissance' },
+ { id: 'scholz', name: 'Olaf Scholz', title: 'Chancellor', country: 'Germany', flag: '๐Ÿ‡ฉ๐Ÿ‡ช',
+ keywords: ['scholz', 'german chancellor', 'berlin'], since: 'Dec 2021', party: 'SPD' },
+ { id: 'meloni', name: 'Giorgia Meloni', title: 'Prime Minister', country: 'Italy', flag: '๐Ÿ‡ฎ๐Ÿ‡น',
+ keywords: ['meloni', 'italian pm', 'italy prime minister'], since: 'Oct 2022', party: 'Brothers of Italy' },
+
+ // Middle East
+ { id: 'netanyahu', name: 'Benjamin Netanyahu', title: 'Prime Minister', country: 'Israel', flag: '๐Ÿ‡ฎ๐Ÿ‡ฑ',
+ keywords: ['netanyahu', 'bibi', 'israeli pm'], since: 'Dec 2022', party: 'Likud',
+ focus: ['gaza', 'iran', 'judicial reform'] },
+ { id: 'mbs', name: 'Mohammed bin Salman', title: 'Crown Prince', country: 'Saudi Arabia', flag: '๐Ÿ‡ธ๐Ÿ‡ฆ',
+ keywords: ['mbs', 'saudi crown prince', 'bin salman'], since: 'Jun 2017', party: 'Royal Family',
+ focus: ['vision 2030', 'oil', 'regional influence'] },
+ { id: 'khamenei', name: 'Ali Khamenei', title: 'Supreme Leader', country: 'Iran', flag: '๐Ÿ‡ฎ๐Ÿ‡ท',
+ keywords: ['khamenei', 'supreme leader', 'ayatollah'], since: 'Jun 1989', party: 'Islamic Republic',
+ focus: ['nuclear program', 'proxies', 'sanctions'] },
+
+ // Asia-Pacific
+ { id: 'modi', name: 'Narendra Modi', title: 'Prime Minister', country: 'India', flag: '๐Ÿ‡ฎ๐Ÿ‡ณ',
+ keywords: ['modi', 'indian pm', 'india prime minister'], since: 'May 2014', party: 'BJP',
+ focus: ['economy', 'china border', 'technology'] },
+ { id: 'kim', name: 'Kim Jong Un', title: 'Supreme Leader', country: 'North Korea', flag: '๐Ÿ‡ฐ๐Ÿ‡ต',
+ keywords: ['kim jong un', 'north korea', 'pyongyang'], since: 'Dec 2011', party: 'Workers Party',
+ focus: ['nuclear', 'missiles', 'russia alliance'] },
+ { id: 'kishida', name: 'Shigeru Ishiba', title: 'Prime Minister', country: 'Japan', flag: '๐Ÿ‡ฏ๐Ÿ‡ต',
+ keywords: ['ishiba', 'japanese pm', 'japan prime minister'], since: 'Oct 2024', party: 'LDP',
+ focus: ['defense', 'china', 'us alliance'] },
+ { id: 'lai', name: 'Lai Ching-te', title: 'President', country: 'Taiwan', flag: '๐Ÿ‡น๐Ÿ‡ผ',
+ keywords: ['lai ching-te', 'taiwan president', 'taipei'], since: 'May 2024', party: 'DPP',
+ focus: ['china relations', 'defense', 'semiconductors'] },
+
+ // Ukraine
+ { id: 'zelensky', name: 'Volodymyr Zelensky', title: 'President', country: 'Ukraine', flag: '๐Ÿ‡บ๐Ÿ‡ฆ',
+ keywords: ['zelensky', 'ukraine president', 'kyiv'], since: 'May 2019', party: 'Servant of the People',
+ focus: ['war', 'western aid', 'nato membership'] },
+
+ // Latin America
+ { id: 'milei', name: 'Javier Milei', title: 'President', country: 'Argentina', flag: '๐Ÿ‡ฆ๐Ÿ‡ท',
+ keywords: ['milei', 'argentina president', 'buenos aires'], since: 'Dec 2023', party: 'La Libertad Avanza',
+ focus: ['dollarization', 'spending cuts', 'deregulation'] },
+ { id: 'lula', name: 'Luiz Inรกcio Lula da Silva', title: 'President', country: 'Brazil', flag: '๐Ÿ‡ง๐Ÿ‡ท',
+ keywords: ['lula', 'brazil president', 'brasilia'], since: 'Jan 2023', party: 'PT',
+ focus: ['amazon', 'social programs', 'brics'] },
+
+ // Canada
+ { id: 'carney', name: 'Mark Carney', title: 'Prime Minister', country: 'Canada', flag: '๐Ÿ‡จ๐Ÿ‡ฆ',
+ keywords: ['carney', 'canadian pm', 'canada prime minister', 'ottawa'], since: 'Mar 2025', party: 'Liberal',
+ focus: ['tariffs', 'us relations', 'economy'] }
+];
+
// AI RSS feeds for arms race tracking
export const AI_FEEDS = [
{ name: 'OpenAI', url: 'https://openai.com/news/rss.xml' },
diff --git a/static/js/data.js b/static/js/data.js
index e8cad26..291745d 100644
--- a/static/js/data.js
+++ b/static/js/data.js
@@ -1,6 +1,6 @@
// data.js - All data fetching functions with service layer integration
-import { CORS_PROXIES, ALERT_KEYWORDS, SECTORS, COMMODITIES, INTEL_SOURCES, AI_FEEDS } from './constants.js';
+import { CORS_PROXIES, ALERT_KEYWORDS, SECTORS, COMMODITIES, INTEL_SOURCES, AI_FEEDS, WORLD_LEADERS } from './constants.js';
import { serviceClient } from './services/index.js';
// Fetch with proxy fallback - now uses ServiceClient
@@ -602,3 +602,47 @@ export async function fetchIntelFeed() {
export function getServiceHealth() {
return serviceClient.getHealthStatus();
}
+
+// Fetch world leaders news - queries GDELT for each leader
+export async function fetchWorldLeaders() {
+ const fetchLeaderNews = async (leader) => {
+ // Build query from leader's keywords
+ const query = leader.keywords.map(k => `"${k}"`).join(' OR ');
+
+ try {
+ const result = await serviceClient.request('GDELT', '/api/v2/doc/doc', {
+ params: {
+ query: query,
+ mode: 'artlist',
+ maxrecords: 5,
+ format: 'json',
+ sort: 'date'
+ }
+ });
+
+ const news = (result.data.articles || []).map(article => ({
+ source: article.domain || 'Unknown',
+ title: article.title || '',
+ link: article.url || '',
+ pubDate: article.seendate || ''
+ }));
+
+ return { ...leader, news };
+ } catch (error) {
+ return { ...leader, news: [] };
+ }
+ };
+
+ // Fetch news for all leaders in parallel (with some batching to avoid rate limits)
+ const batchSize = 5;
+ const results = [];
+
+ for (let i = 0; i < WORLD_LEADERS.length; i += batchSize) {
+ const batch = WORLD_LEADERS.slice(i, i + batchSize);
+ const batchResults = await Promise.allSettled(batch.map(fetchLeaderNews));
+ results.push(...batchResults.map(r => r.status === 'fulfilled' ? r.value : null).filter(Boolean));
+ }
+
+ // Sort by news activity (leaders with more news first)
+ return results.sort((a, b) => (b.news?.length || 0) - (a.news?.length || 0));
+}
diff --git a/static/js/main.js b/static/js/main.js
index 57161b7..00e4e7e 100644
--- a/static/js/main.js
+++ b/static/js/main.js
@@ -7,7 +7,8 @@ import {
fetchCategory, fetchMarkets, fetchSectors, fetchCommodities,
fetchEarthquakes, fetchWhaleTransactions,
fetchGovContracts, fetchAINews, fetchFedBalance, fetchPolymarket,
- fetchLayoffs, fetchSituationNews, fetchIntelFeed, fetchGDELTNews
+ fetchLayoffs, fetchSituationNews, fetchIntelFeed, fetchGDELTNews,
+ fetchWorldLeaders
} from './data.js';
import { renderGlobalMap } from './map.js';
import {
@@ -18,7 +19,8 @@ import {
renderNews, renderMarkets, renderHeatmap, renderCommodities,
renderPolymarket, renderWhaleWatch,
renderMainCharacter, renderGovContracts, renderAINews,
- renderMoneyPrinter, renderIntelFeed, renderLayoffs, renderSituation
+ renderMoneyPrinter, renderIntelFeed, renderLayoffs, renderSituation,
+ renderWorldLeaders
} from './renderers.js';
import {
analyzeCorrelations, renderCorrelationEngine,
@@ -191,7 +193,7 @@ async function refreshAll() {
setStatus('Loading extras...', true);
// STAGE 3: Extra data - lowest priority
- let whales = [], contracts = [], aiNews = [], layoffs = [], venezuelaNews = [], greenlandNews = [], iranNews = [], intelFeed = [];
+ let whales = [], contracts = [], aiNews = [], layoffs = [], venezuelaNews = [], greenlandNews = [], iranNews = [], intelFeed = [], leadersData = [];
try {
const stage3Promise = Promise.allSettled([
isPanelEnabled('whales') ? fetchWhaleTransactions() : Promise.resolve([]),
@@ -201,7 +203,8 @@ async function refreshAll() {
isPanelEnabled('venezuela') ? fetchSituationNews('venezuela maduro caracas crisis') : Promise.resolve([]),
isPanelEnabled('greenland') ? fetchSituationNews('greenland denmark trump arctic') : Promise.resolve([]),
isPanelEnabled('iran') ? fetchSituationNews('iran (protest OR uprising OR revolution OR nuclear OR irgc OR sanctions)') : Promise.resolve([]),
- isPanelEnabled('intel') ? fetchIntelFeed() : Promise.resolve([])
+ isPanelEnabled('intel') ? fetchIntelFeed() : Promise.resolve([]),
+ isPanelEnabled('leaders') ? fetchWorldLeaders() : Promise.resolve([])
]);
const results = await stage3Promise;
@@ -213,6 +216,7 @@ async function refreshAll() {
greenlandNews = results[5].status === 'fulfilled' ? results[5].value : [];
iranNews = results[6].status === 'fulfilled' ? results[6].value : [];
intelFeed = results[7].status === 'fulfilled' ? results[7].value : [];
+ leadersData = results[8].status === 'fulfilled' ? results[8].value : [];
} catch (e) {
console.error('Stage 3 error:', e);
}
@@ -243,6 +247,7 @@ async function refreshAll() {
criticalKeywords: ['protest', 'uprising', 'revolution', 'crackdown', 'killed', 'shot', 'nuclear', 'strike', 'attack', 'irgc', 'khamenei']
});
}
+ if (isPanelEnabled('leaders')) renderWorldLeaders(leadersData);
// Render My Monitors panel with all news
if (isPanelEnabled('monitors')) {
diff --git a/static/js/renderers.js b/static/js/renderers.js
index 2f1f42d..fb1cd2a 100644
--- a/static/js/renderers.js
+++ b/static/js/renderers.js
@@ -456,3 +456,52 @@ export function renderSituation(panelId, statusId, news, config) {
${newsHTML}
`;
}
+
+// Render World Leaders panel
+export function renderWorldLeaders(leadersData) {
+ const panel = document.getElementById('leadersPanel');
+ const count = document.getElementById('leadersCount');
+
+ if (!leadersData || leadersData.length === 0) {
+ panel.innerHTML = '<div class="loading-msg">Loading leaders data...</div>';
+ count.textContent = '-';
+ return;
+ }
+
+ count.textContent = leadersData.length;
+
+ panel.innerHTML = `<div class="leaders-grid">${leadersData.map(leader => {
+ const newsCount = leader.news?.length || 0;
+ const activityClass = newsCount >= 3 ? 'high-activity' : newsCount >= 1 ? 'active' : '';
+ const latestNews = leader.news?.slice(0, 2) || [];
+ const focusTopics = leader.focus?.slice(0, 3).map(f => `<span class="leader-focus">${f}</span>`).join('') || '';
+
+ return `
+ <div class="leader-card ${activityClass}">
+ <div class="leader-header">
+ <span class="leader-flag">${leader.flag}</span>
+ <div class="leader-info">
+ <div class="leader-name">${leader.name}</div>
+ <div class="leader-title">${leader.title}</div>
+ <div class="leader-country">${leader.country}</div>
+ </div>
+ ${newsCount > 0 ? `<div class="leader-activity-badge">${newsCount}</div>` : ''}
+ </div>
+ <div class="leader-meta">
+ <span class="leader-since">Since ${leader.since}</span>
+ <span class="leader-party">${leader.party}</span>
+ </div>
+ ${focusTopics ? `<div class="leader-focus-topics">${focusTopics}</div>` : ''}
+ ${latestNews.length > 0 ? `
+ <div class="leader-news">
+ ${latestNews.map(n => `
+ <a href="${n.link}" target="_blank" class="leader-news-item" title="${n.title}">
+ ${n.title.length > 60 ? n.title.substring(0, 60) + '...' : n.title}
+ </a>
+ `).join('')}
+ </div>
+ ` : ''}
+ </div>
+ `;
+ }).join('')}</div>`;
+}
diff --git a/static/styles.css b/static/styles.css
index b9101a1..b97a83a 100644
--- a/static/styles.css
+++ b/static/styles.css
@@ -5033,6 +5033,149 @@
position: relative;
}
+/* ==========================================
+ WORLD LEADERS PANEL
+ ========================================== */
+.leaders-panel {
+ padding: 0.5rem;
+}
+
+.leaders-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
+ gap: 0.75rem;
+}
+
+.leader-card {
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: 6px;
+ padding: 0.75rem;
+ transition: all 0.2s;
+}
+
+.leader-card:hover {
+ border-color: var(--border-light);
+ background: var(--surface-hover);
+}
+
+.leader-card.active {
+ border-color: var(--info);
+}
+
+.leader-card.high-activity {
+ border-color: var(--warning);
+ box-shadow: 0 0 8px rgba(255, 170, 0, 0.2);
+}
+
+.leader-header {
+ display: flex;
+ align-items: flex-start;
+ gap: 0.5rem;
+ margin-bottom: 0.5rem;
+}
+
+.leader-flag {
+ font-size: 1.5rem;
+ line-height: 1;
+}
+
+.leader-info {
+ flex: 1;
+ min-width: 0;
+}
+
+.leader-name {
+ font-size: 0.8rem;
+ font-weight: 600;
+ color: var(--text-primary);
+ line-height: 1.2;
+}
+
+.leader-title {
+ font-size: 0.65rem;
+ color: var(--text-dim);
+ margin-top: 0.1rem;
+}
+
+.leader-country {
+ font-size: 0.6rem;
+ color: var(--text-muted);
+ margin-top: 0.15rem;
+}
+
+.leader-activity-badge {
+ background: var(--info);
+ color: #000;
+ font-size: 0.55rem;
+ font-weight: bold;
+ padding: 0.15rem 0.35rem;
+ border-radius: 3px;
+ min-width: 18px;
+ text-align: center;
+}
+
+.leader-card.high-activity .leader-activity-badge {
+ background: var(--warning);
+}
+
+.leader-meta {
+ display: flex;
+ gap: 0.5rem;
+ font-size: 0.55rem;
+ color: var(--text-muted);
+ margin-bottom: 0.5rem;
+}
+
+.leader-since {
+ color: var(--text-dim);
+}
+
+.leader-party {
+ color: var(--text-muted);
+ opacity: 0.8;
+}
+
+.leader-focus-topics {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.25rem;
+ margin-bottom: 0.5rem;
+}
+
+.leader-focus {
+ font-size: 0.5rem;
+ background: rgba(68, 136, 255, 0.15);
+ color: var(--info);
+ padding: 0.1rem 0.35rem;
+ border-radius: 3px;
+ text-transform: lowercase;
+}
+
+.leader-news {
+ border-top: 1px solid var(--border);
+ padding-top: 0.5rem;
+ margin-top: 0.25rem;
+}
+
+.leader-news-item {
+ display: block;
+ font-size: 0.6rem;
+ color: var(--text-dim);
+ text-decoration: none;
+ padding: 0.25rem 0;
+ line-height: 1.3;
+ border-bottom: 1px solid var(--border);
+}
+
+.leader-news-item:last-child {
+ border-bottom: none;
+}
+
+.leader-news-item:hover {
+ color: var(--text-primary);
+}
+
/* ==========================================
TABLET BREAKPOINT (768px)
========================================== */