diff --git a/apis/sources/who.mjs b/apis/sources/who.mjs index f3adde1..ac0dd96 100644 --- a/apis/sources/who.mjs +++ b/apis/sources/who.mjs @@ -51,7 +51,11 @@ export async function getOutbreakNews() { return db - da; }); - return items.map(item => ({ + // Filter to last 30 days only + const cutoff = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000); + const recent = items.filter(item => new Date(item.PublicationDate || 0) >= cutoff); + + return recent.map(item => ({ title: item.Title, date: item.PublicationDate, donId: item.DonId || null, diff --git a/dashboard/inject.mjs b/dashboard/inject.mjs index 9dfd39b..3f294ac 100644 --- a/dashboard/inject.mjs +++ b/dashboard/inject.mjs @@ -126,13 +126,26 @@ async function fetchRSS(url, source) { export async function fetchAllNews() { const feeds = [ + // Global ['http://feeds.bbci.co.uk/news/world/rss.xml', 'BBC'], ['https://rss.nytimes.com/services/xml/rss/nyt/World.xml', 'NYT'], ['https://www.aljazeera.com/xml/rss/all.xml', 'Al Jazeera'], - ['https://rss.nytimes.com/services/xml/rss/nyt/Americas.xml', 'NYT Americas'], - ['https://rss.nytimes.com/services/xml/rss/nyt/AsiaPacific.xml', 'NYT Asia'], + // USA + ['https://feeds.npr.org/1001/rss.xml', 'NPR'], ['https://feeds.bbci.co.uk/news/technology/rss.xml', 'BBC Tech'], ['http://feeds.bbci.co.uk/news/science_and_environment/rss.xml', 'BBC Science'], + ['https://rss.nytimes.com/services/xml/rss/nyt/Americas.xml', 'NYT Americas'], + // Europe + ['https://rss.dw.com/rdf/rss-en-all', 'DW'], + ['https://www.france24.com/en/rss', 'France 24'], + ['https://www.euronews.com/rss?format=mrss', 'Euronews'], + // Africa & Cameroon region + ['https://rss.dw.com/rdf/rss-en-africa', 'DW Africa'], + ['https://www.rfi.fr/en/rss', 'RFI'], + ['https://www.africanews.com/feed/rss', 'Africa News'], + ['https://rss.nytimes.com/services/xml/rss/nyt/Africa.xml', 'NYT Africa'], + // Asia-Pacific + ['https://rss.nytimes.com/services/xml/rss/nyt/AsiaPacific.xml', 'NYT Asia'], ]; const results = await Promise.allSettled( @@ -164,8 +177,10 @@ export async function fetchAllNews() { } } - geoNews.sort((a, b) => new Date(b.date || 0) - new Date(a.date || 0)); - return geoNews.slice(0, 50); + const cutoff = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000); + const filtered = geoNews.filter(n => !n.date || new Date(n.date) >= cutoff); + filtered.sort((a, b) => new Date(b.date || 0) - new Date(a.date || 0)); + return filtered.slice(0, 50); } // === Leverageable Ideas from Signals === @@ -549,9 +564,11 @@ function buildNewsFeed(rssNews, gdeltData, tgUrgent, tgTop) { }); } - // Sort by timestamp descending, limit to 50 - feed.sort((a, b) => new Date(b.timestamp || 0) - new Date(a.timestamp || 0)); - return feed.slice(0, 50); + // Filter to last 30 days, sort by timestamp descending, limit to 50 + const cutoff = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000); + const recent = feed.filter(item => !item.timestamp || new Date(item.timestamp) >= cutoff); + recent.sort((a, b) => new Date(b.timestamp || 0) - new Date(a.timestamp || 0)); + return recent.slice(0, 50); } // === CLI Mode: inject into HTML file === diff --git a/dashboard/public/jarvis.html b/dashboard/public/jarvis.html index aab4025..c130f9c 100644 --- a/dashboard/public/jarvis.html +++ b/dashboard/public/jarvis.html @@ -213,7 +213,7 @@ html,body{height:100%;background:var(--bg);color:var(--text);font-family:var(--s .ticker-wrap::before,.ticker-wrap::after{content:'';position:absolute;left:0;right:0;height:30px;z-index:2;pointer-events:none} .ticker-wrap::before{top:0;background:linear-gradient(to bottom,rgba(14,17,22,0.95),transparent)} .ticker-wrap::after{bottom:0;background:linear-gradient(to top,rgba(14,17,22,0.95),transparent)} -.ticker-track{display:flex;flex-direction:column;animation:tickerScroll var(--ticker-duration,30s) linear infinite} +.ticker-track{display:flex;flex-direction:column;animation:tickerScroll var(--ticker-duration,30s) linear infinite;will-change:transform;contain:layout style} .ticker-wrap:hover .ticker-track{animation-play-state:paused} @keyframes tickerScroll{0%{transform:translateY(0)}100%{transform:translateY(-50%)}} .tk-card{padding:8px 10px;border-bottom:1px solid rgba(255,255,255,0.03);cursor:default;transition:background 0.2s} @@ -229,6 +229,9 @@ html,body{height:100%;background:var(--bg);color:var(--text);font-family:var(--s .tk-src.alj{color:#ffd54f;border-color:rgba(255,213,79,0.3)} .tk-src.gdelt{color:#4dd0e1;border-color:rgba(77,208,225,0.3)} .tk-src.tg{color:#ffb74d;border-color:rgba(255,183,77,0.3)} +.tk-src.dw{color:#ef9a9a;border-color:rgba(239,154,154,0.3)} +.tk-src.eu{color:#ce93d8;border-color:rgba(206,147,216,0.3)} +.tk-src.af{color:#a5d6a7;border-color:rgba(165,214,167,0.3)} .tk-src.other{color:#b0bec5;border-color:rgba(176,190,197,0.2)} .tk-head{font-size:11px;line-height:1.35;color:#c8d8d2;margin-top:3px} .tk-time{font-family:var(--mono);font-size:8px;color:var(--dim);margin-top:2px} @@ -1361,7 +1364,7 @@ function renderLower(){ const srcHtml=D.health.map(s=>`
${s.n}
`).join(''); // NEWS TICKER — merges RSS + GDELT + Telegram into flowing cards (moved from right rail) - const feed = (D.newsFeed || []).slice(0, 40); + const feed = (D.newsFeed || []).slice(0, 20); const srcClass = s => { if (!s) return 'other'; const sl = s.toLowerCase(); @@ -1370,6 +1373,9 @@ function renderLower(){ if (sl.includes('jazeera') || sl.includes('alj')) return 'alj'; if (sl.includes('gdelt')) return 'gdelt'; if (sl.includes('telegram')) return 'tg'; + if (sl.includes('dw') || sl.includes('deutsche')) return 'dw'; + if (sl.includes('france') || sl.includes('rfi') || sl.includes('euronews')) return 'eu'; + if (sl.includes('africa') || sl.includes('npr')) return 'af'; return 'other'; }; const tickerCards = feed.map(n => {