Real-time dashboard for monitoring global news, markets, and geopolitical events
TypeScript
Fix broken RSS feeds and deploy Cloudflare Worker proxy
Sean Thielen-Esparzacf62b35fa1f2
diff --git a/js/constants.js b/js/constants.jsindex 0dd9641..0819c91 100644--- a/js/constants.js+++ b/js/constants.js@@ -52,7 +52,7 @@ export const FEEDS = {{ name: 'BBC World', url: 'https://feeds.bbci.co.uk/news/world/rss.xml' },{ name: 'NPR News', url: 'https://feeds.npr.org/1001/rss.xml' },{ name: 'Guardian World', url: 'https://www.theguardian.com/world/rss' },- { name: 'Reuters World', url: 'https://www.reutersagency.com/feed/?taxonomy=best-sectors&post_type=best' }+ { name: 'NYT World', url: 'https://rss.nytimes.com/services/xml/rss/nyt/World.xml' }],tech: [{ name: 'Hacker News', url: 'https://hnrss.org/frontpage' },@@ -66,15 +66,14 @@ export const FEEDS = {{ name: 'CNBC', url: 'https://www.cnbc.com/id/100003114/device/rss/rss.html' },{ name: 'MarketWatch', url: 'https://feeds.marketwatch.com/marketwatch/topstories' },{ name: 'Yahoo Finance', url: 'https://finance.yahoo.com/news/rssindex' },- { name: 'Reuters Business', url: 'https://www.reutersagency.com/feed/?best-topics=business-finance&post_type=best' },+ { name: 'BBC Business', url: 'https://feeds.bbci.co.uk/news/business/rss.xml' },{ name: 'FT', url: 'https://www.ft.com/rss/home' }],gov: [{ name: 'White House', url: 'https://www.whitehouse.gov/news/feed/' },{ name: 'Federal Reserve', url: 'https://www.federalreserve.gov/feeds/press_all.xml' },{ name: 'SEC Announcements', url: 'https://www.sec.gov/news/pressreleases.rss' },- { name: 'Treasury', url: 'https://home.treasury.gov/system/files/136/treasury-rss.xml' },- { name: 'State Dept', url: 'https://www.state.gov/rss-feed/press-releases/feed/' }+ { name: 'DoD News', url: 'https://www.defense.gov/DesktopModules/ArticleCS/RSS.ashx?max=10&ContentType=1&Site=945' }]};@@ -91,7 +90,7 @@ export const INTEL_SOURCES = [{ name: 'Al-Monitor', url: 'https://www.al-monitor.com/rss', type: 'regional', topics: ['middle-east'], region: 'MENA' },{ name: 'Bellingcat', url: 'https://www.bellingcat.com/feed/', type: 'osint', topics: ['investigation', 'osint'] },{ name: 'DoD News', url: 'https://www.defense.gov/DesktopModules/ArticleCS/RSS.ashx?max=10&ContentType=1&Site=945', type: 'govt', topics: ['military', 'official'] },- { name: 'State Dept', url: 'https://www.state.gov/rss-feed/press-releases/feed/', type: 'govt', topics: ['diplomacy', 'official'] },+ { name: 'CSIS Analysis', url: 'https://www.csis.org/analysis/feed', type: 'govt', topics: ['diplomacy', 'official'] },{ name: 'CISA Alerts', url: 'https://www.cisa.gov/uscert/ncas/alerts.xml', type: 'cyber', topics: ['cyber', 'security'] },{ name: 'Krebs Security', url: 'https://krebsonsecurity.com/feed/', type: 'cyber', topics: ['cyber', 'security'] }];@@ -1126,6 +1125,6 @@ export const AI_FEEDS = [{ name: 'Google AI', url: 'https://blog.google/technology/ai/rss/' },{ name: 'DeepMind', url: 'https://deepmind.google/blog/rss.xml' },{ name: 'Hugging Face', url: 'https://huggingface.co/blog/feed.xml' },- { name: 'MIT AI News', url: 'https://news.mit.edu/topic/artificial-intelligence2-rss.xml' },+ { name: 'MIT AI News', url: 'https://news.mit.edu/rss/topic/artificial-intelligence2' },{ name: 'VentureBeat AI', url: 'https://venturebeat.com/category/ai/feed' }];diff --git a/js/data.js b/js/data.jsindex 62835bf..4f96237 100644--- a/js/data.js+++ b/js/data.js@@ -373,15 +373,12 @@ export async function fetchAINews() {return results.flat().sort((a, b) => new Date(b.date) - new Date(a.date)).slice(0, 15);}-// Fetch Fed balance sheet from FRED - now with ServiceClient+// Fetch Fed balance sheet from FRED - routed through CORS proxyexport async function fetchFedBalance() {try {- const result = await serviceClient.request('FRED', '/graph/fredgraph.csv', {- params: { id: 'WALCL', cosd: '2024-01-01' },- responseType: 'text'- });-- const text = result.data;+ // FRED doesn't support CORS, so we route through proxy+ const fredUrl = 'https://fred.stlouisfed.org/graph/fredgraph.csv?id=WALCL&cosd=2024-01-01';+ const text = await serviceClient.fetchWithProxy(fredUrl);// Parse CSV (format: observation_date,WALCL)const lines = text.trim().split('\n').slice(1); // Skip headerdiff --git a/js/renderers.js b/js/renderers.jsindex 81e6c91..09791fe 100644--- a/js/renderers.js+++ b/js/renderers.js@@ -131,9 +131,12 @@ export function renderPolymarket(markets) {}const formatVolume = (v) => {+ // Handle pre-formatted strings (e.g., '2.4M')+ if (typeof v === 'string') return '$' + v;+ // Handle numeric valuesif (v >= 1000000) return '$' + (v / 1000000).toFixed(1) + 'M';if (v >= 1000) return '$' + (v / 1000).toFixed(0) + 'K';- return '$' + v.toFixed(0);+ return '$' + (v || 0).toFixed(0);};panel.innerHTML = markets.map(m => `diff --git a/js/services/ServiceRegistry.js b/js/services/ServiceRegistry.jsindex db37b1b..1be7c64 100644--- a/js/services/ServiceRegistry.js+++ b/js/services/ServiceRegistry.js@@ -80,7 +80,7 @@ const SERVICE_CONFIG = {id: 'cors_proxy',baseUrl: null, // Uses proxy URLs from listproxies: [- 'https://corsproxy.io/?',+ 'https://situation-monitor-proxy.seanthielen-e.workers.dev/?url=','https://api.allorigins.win/raw?url='],timeout: 12000,diff --git a/workers/proxy/index.js b/workers/proxy/index.jsindex c048079..e8c9872 100644--- a/workers/proxy/index.js+++ b/workers/proxy/index.js@@ -7,24 +7,52 @@ const ALLOWED_ORIGINS = ['api.coingecko.com','fred.stlouisfed.org','earthquake.usgs.gov',- // RSS feeds+ // News RSS feeds'feeds.bbci.co.uk','feeds.npr.org','rss.nytimes.com',- 'feeds.reuters.com','rss.cnn.com','www.theguardian.com',+ 'apnews.com',+ // Tech feeds'news.ycombinator.com',+ 'hnrss.org','feeds.arstechnica.com','www.theverge.com',- 'blog.openai.com',+ 'www.technologyreview.com','feeds.feedburner.com','arxiv.org',+ 'rss.arxiv.org',+ // Finance feeds+ 'www.cnbc.com',+ 'feeds.marketwatch.com',+ 'finance.yahoo.com',+ 'www.ft.com',+ // Government feeds'www.whitehouse.gov','www.federalreserve.gov','www.sec.gov',- 'home.treasury.gov',- 'www.state.gov'+ 'www.defense.gov',+ 'www.cisa.gov',+ // Intel/Defense feeds+ 'www.csis.org',+ 'www.brookings.edu',+ 'www.cfr.org',+ 'www.defenseone.com',+ 'warontherocks.com',+ 'breakingdefense.com',+ 'www.thedrive.com',+ 'thediplomat.com',+ 'www.al-monitor.com',+ 'www.bellingcat.com',+ 'krebsonsecurity.com',+ // AI news feeds+ 'openai.com',+ 'venturebeat.com',+ 'blog.google',+ 'news.mit.edu',+ 'huggingface.co',+ 'deepmind.google'];// Cache TTLs by content type/host (in seconds)