Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ failed_feeds.txt
!stats.json
!sources/
!sources/*.json
!category_summaries.json
31 changes: 31 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,29 @@
}
}

// Cache for AI-generated category summaries loaded from category_summaries.json
let categorySummariesCache = null;

/**
* Load category_summaries.json once and return the entry for catName, or null.
* Silently ignores fetch errors (file may not exist if summaries have not been generated yet).
*/
async function fetchCategorySummary(catName) {
if (categorySummariesCache === null) {
try {
const res = await fetch('category_summaries.json', { cache: 'no-store' });
if (res.ok) {
categorySummariesCache = await res.json();
} else {
categorySummariesCache = {};
}
} catch (_e) {
categorySummariesCache = {};
}
}
return categorySummariesCache[catName] || null;
}

function filterByCategory(catName) {
currentCategory = catName;
const viewTitle = document.getElementById('current-view-title');
Expand All @@ -835,12 +858,20 @@
// KÄÄNNÖS: Näytetään käännetty nimi, mutta logiikka käyttää catNamea
if (viewTitle) viewTitle.innerText = getTranslation('cat', catName);

// Show a default description immediately, then overlay with an AI summary if available
if (viewDesc) viewDesc.innerText = `${t('ui.latest_news_from_the_category')} ${getTranslation('cat', catName)}`;
if (logoCont) {
logoCont.innerHTML = "";
logoCont.style.display = 'none';
}

// Asynchronously replace the description with the cached AI summary when present
fetchCategorySummary(catName).then(entry => {
if (entry && entry.summary && viewDesc) {
viewDesc.innerText = entry.summary;
}
});

displayedCount = 0;
document.querySelectorAll('.source-item').forEach(i => i.classList.remove('active'));
mainFeedCache = null;
Expand Down
249 changes: 249 additions & 0 deletions category_summaries.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
{
"Global policy": {
"summary": "Recent coverage in Global policy (10 articles from 5 sources) includes \"Presidentti Stubb valtiovierailulle Intiaan\", \"Safeguarding the “Sovereignty of Mind” in the Age of AI\", \"Mitä haluat tietää Iranin sodasta? Kysy – me etsimme vastauksia\".",
"timestamp": "2026-03-02T19:14:05.993Z",
"articleCount": 10,
"topArticles": [
{
"title": "Presidentti Stubb valtiovierailulle Intiaan",
"link": "https://yle.fi/a/74-20213189?origin=rss"
},
{
"title": "Safeguarding the “Sovereignty of Mind” in the Age of AI",
"link": "https://www.global-solutions-initiative.org/article/test/"
},
{
"title": "Mitä haluat tietää Iranin sodasta? Kysy – me etsimme vastauksia",
"link": "https://yle.fi/a/74-20213069?origin=rss"
}
]
},
"Human Rights + Democracy": {
"summary": "Recent coverage in Human Rights + Democracy (10 articles from 5 sources) includes \"Zimbabwe: Authorities must investigate brutal attack on constitutional lawyer and political activists\", \"Pakistan: Investigation urgently needed after killings during Iran protests \", \"Borna Naeimi, a Baha’i Citizen, Arrested in Kerman\".",
"timestamp": "2026-03-02T19:12:09.999Z",
"articleCount": 10,
"topArticles": [
{
"title": "Zimbabwe: Authorities must investigate brutal attack on constitutional lawyer and political activists",
"link": "https://www.amnesty.org/en/latest/news/2026/03/zimbabwe-authorities-must-investigate-brutal-attack-on-constitutional-lawyer-and-political-activists/"
},
{
"title": "Pakistan: Investigation urgently needed after killings during Iran protests ",
"link": "https://www.amnesty.org/en/latest/news/2026/03/pakistan-investigation-urgently-needed-after-killings-during-iran-protests/"
},
{
"title": "Borna Naeimi, a Baha’i Citizen, Arrested in Kerman",
"link": "https://www.en-hrana.org/borna-naeimi-a-bahai-citizen-arrested-in-kerman/"
}
]
},
"Perspectives": {
"summary": "Recent coverage in Perspectives (10 articles from 3 sources) includes \"Miksi Trump vei Yhdysvallat sotaan, jota amerikkalaiset eivät halua? – Viestit sodan perusteluista ovat hämmentäviä\", \"Mikä show! Suomen tulevat euro­viisu­edustajat juhlivat konfetti­sateessa\", \"Trumpin tullit leikkasivat Suomen vientiä – EU voisi kovistella paremman sopimuksen, EK:n johtaja sanoo\".",
"timestamp": "2026-03-02T19:12:11.006Z",
"articleCount": 10,
"topArticles": [
{
"title": "Miksi Trump vei Yhdysvallat sotaan, jota amerikkalaiset eivät halua? – Viestit sodan perusteluista ovat hämmentäviä",
"link": "https://suomenkuvalehti.fi/paajutut/miksi-trump-vei-yhdysvallat-sotaan-jota-amerikkalaiset-eivat-halua-viestit-sodan-perusteluista-ovat-hammentavia/"
},
{
"title": "Mikä show! Suomen tulevat euro­viisu­edustajat juhlivat konfetti­sateessa",
"link": "https://suomenkuvalehti.fi/uutisviikko/mika-show-suomen-euroviisuedustajat-juhlivat-konfettisateessa/"
},
{
"title": "Trumpin tullit leikkasivat Suomen vientiä – EU voisi kovistella paremman sopimuksen, EK:n johtaja sanoo",
"link": "https://suomenkuvalehti.fi/uutisviikko/trumpin-tullit-leikkasivat-suomen-vientia-eu-voisi-kovistella-paremman-sopimuksen-ekn-johtaja-sanoo/"
}
]
},
"Digital policy + rights": {
"summary": "Recent coverage in Digital policy + rights (10 articles from 7 sources) includes \"Rakennusala etsii ratkaisuja datan liikkumiseen – Varasto-hankkeen työpaja avasi keskustelun digitalisaation käytännön askelista \", \"National Book Tour for Cindy Cohn’s Memoir, ‘Privacy’s Defender’\", \"Putin’s Legacy: Nations of Widows and Orphans\".",
"timestamp": "2026-03-02T19:12:12.517Z",
"articleCount": 10,
"topArticles": [
{
"title": "Rakennusala etsii ratkaisuja datan liikkumiseen – Varasto-hankkeen työpaja avasi keskustelun digitalisaation käytännön askelista ",
"link": "https://tieke.fi/rakennusala-etsii-ratkaisuja-datan-liikkumiseen-varasto-hankkeen-tyopaja-avasi-keskustelun-digitalisaation-kaytannon-askelista/"
},
{
"title": "National Book Tour for Cindy Cohn’s Memoir, ‘Privacy’s Defender’",
"link": "https://www.eff.org/press/releases/national-book-tour-cindy-cohns-memoir-privacys-defender"
},
{
"title": "Putin’s Legacy: Nations of Widows and Orphans",
"link": "https://cepa.org/article/putins-legacy-nations-of-widows-and-orphans/"
}
]
},
"(Open) Science + Research": {
"summary": "Recent coverage in (Open) Science + Research (10 articles from 5 sources) includes \"Yhteiskunnallisen turvallisuuden hub aloittaa toimintansa\", \"Siitepölykausi on alkanut Suomessa\", \"Reasearch visit: Carbon observation exchanges in China\".",
"timestamp": "2026-03-02T19:12:12.517Z",
"articleCount": 10,
"topArticles": [
{
"title": "Yhteiskunnallisen turvallisuuden hub aloittaa toimintansa",
"link": "https://www.helsinki.fi/fi/valtiotieteellinen-tiedekunta/ajankohtaista/yhteiskunnallisen-turvallisuuden-hub-aloittaa-toimintansa"
},
{
"title": "Siitepölykausi on alkanut Suomessa",
"link": "https://www.utu.fi/fi/ajankohtaista/mediatiedote/siitepolykausi-on-alkanut-suomessa"
},
{
"title": "Reasearch visit: Carbon observation exchanges in China",
"link": "https://www.helsinki.fi/en/researchgroups/micrometeorology/micrometeorology-news/reasearch-visit-carbon-observation-exchanges-in-china"
}
]
},
"Politics + Government": {
"summary": "Recent coverage in Politics + Government (10 articles from 5 sources) includes \"Commission Unveils Updated Learning Opportunities for Customs and Tax Professionals\", \"‘Hope for Indigenous peoples’: An unexpected birth could bring this Amazon tribe back from the brink\", \"Flood of AI-generated ICE videos risks undermining trust in real footage, experts warn\".",
"timestamp": "2026-03-02T19:12:14.530Z",
"articleCount": 10,
"topArticles": [
{
"title": "Commission Unveils Updated Learning Opportunities for Customs and Tax Professionals",
"link": "https://taxation-customs.ec.europa.eu/news/commission-unveils-updated-learning-opportunities-customs-and-tax-professionals-2026-03-02_en"
},
{
"title": "‘Hope for Indigenous peoples’: An unexpected birth could bring this Amazon tribe back from the brink",
"link": "http://www.euronews.com/my-europe/2026/03/02/hope-for-indigenous-peoples-an-unexpected-birth-could-bring-this-amazon-tribe-back-from-th"
},
{
"title": "Flood of AI-generated ICE videos risks undermining trust in real footage, experts warn",
"link": "http://www.euronews.com/my-europe/2026/03/02/flood-of-ai-generated-ice-videos-risks-undermining-trust-in-real-footage-experts-warn"
}
]
},
"(Open) Data + Technology": {
"summary": "Recent coverage in (Open) Data + Technology (10 articles from 4 sources) includes \"‘The digital colonization of flyover states’: how datacenters are tearing small-town America apart\", \"Stardew Valley at 10: the anticapitalist game that cures burnout and inspires queer art\", \"I’m on the Meta Oversight Board. We need AI protections now | Suzanne Nossel\".",
"timestamp": "2026-03-02T19:12:14.531Z",
"articleCount": 10,
"topArticles": [
{
"title": "‘The digital colonization of flyover states’: how datacenters are tearing small-town America apart",
"link": "https://www.theguardian.com/us-news/2026/mar/02/amazon-data-centers-small-towns"
},
{
"title": "Stardew Valley at 10: the anticapitalist game that cures burnout and inspires queer art",
"link": "https://www.theguardian.com/games/2026/mar/02/stardew-valley-at-10-the-anticapitalist-game-that-cures-burnout-and-inspires-queer-art"
},
{
"title": "I’m on the Meta Oversight Board. We need AI protections now | Suzanne Nossel",
"link": "https://www.theguardian.com/commentisfree/2026/mar/02/meta-oversight-board-ai"
}
]
},
"Cultural policy": {
"summary": "Recent coverage in Cultural policy (10 articles from 4 sources) includes \"Libraries Advancing Community Engagement in Africa and Europe\", \"Europe Day 2026: Add Your Event to the Shared European Agenda\", \"Tervetuloa seuraamaan Kotuksen juhlaseminaaria!\".",
"timestamp": "2026-03-02T19:12:15.035Z",
"articleCount": 10,
"topArticles": [
{
"title": "Libraries Advancing Community Engagement in Africa and Europe",
"link": "https://culturalfoundation.eu/stories/libraries-advancing-community-engagement-in-africa-and-europe/"
},
{
"title": "Europe Day 2026: Add Your Event to the Shared European Agenda",
"link": "https://culturalfoundation.eu/stories/europe-day-2026-add-your-event-to-the-shared-european-agenda/"
},
{
"title": "Tervetuloa seuraamaan Kotuksen juhlaseminaaria!",
"link": "https://kotus.fi/tervetuloa-seuraamaan-juhlaseminaaria/"
}
]
},
"Culture": {
"summary": "Recent coverage in Culture (10 articles from 8 sources) includes \"MERITA Platform announces 44 young chamber music ensembles from across Europe in the frame of MERITAcubed\", \"Hae EDUFI-harjoitteluun Tukholmaan!\", \"Sök EDUFI-praktik hos oss för hösten 2026!\".",
"timestamp": "2026-03-02T19:12:15.537Z",
"articleCount": 10,
"topArticles": [
{
"title": "MERITA Platform announces 44 young chamber music ensembles from across Europe in the frame of MERITAcubed",
"link": "https://www.europanostra.org/merita-platform-announces-44-young-chamber-music-ensembles-from-across-europe-in-the-frame-of-meritacubed/"
},
{
"title": "Hae EDUFI-harjoitteluun Tukholmaan!",
"link": "https://finlandsinstitutet.se/fi/hae-edufi-harjoitteluun-tukholmaan/"
},
{
"title": "Sök EDUFI-praktik hos oss för hösten 2026!",
"link": "https://finlandsinstitutet.se/sok-praktikplats-for-hosten-2026/"
}
]
},
"Sustainability + Foresight": {
"summary": "Recent coverage in Sustainability + Foresight (10 articles from 4 sources) includes \"Analysis: Half of nations meet UN deadline for nature-loss reporting\", \"Kääntyykö Béla Bartók haudassaan oopperansa uustulkinnasta?\", \"Laaja sidosryhmäjoukko osallistui ympäristöministeriön strategiatyöhön liittyvään nykytilakyselyyn\".",
"timestamp": "2026-03-02T19:12:17.045Z",
"articleCount": 10,
"topArticles": [
{
"title": "Analysis: Half of nations meet UN deadline for nature-loss reporting",
"link": "https://www.carbonbrief.org/analysis-half-of-nations-meet-un-deadline-for-nature-loss-reporting/"
},
{
"title": "Kääntyykö Béla Bartók haudassaan oopperansa uustulkinnasta?",
"link": "https://www.verdelehti.fi/2026/03/02/kaantyyko-bela-bartok-haudassaan-oopperansa-uustulkinnasta/"
},
{
"title": "Laaja sidosryhmäjoukko osallistui ympäristöministeriön strategiatyöhön liittyvään nykytilakyselyyn",
"link": "https://ym.fi/-/laaja-sidosryhmajoukko-osallistui-ymparistoministerion-strategiatyohon-liittyvaan-nykytilakyselyyn"
}
]
},
"Digital cultural heritage": {
"summary": "Recent coverage in Digital cultural heritage (10 articles from 6 sources) includes \"ENCATC Education and Research Sessions: Call for proposals\", \"Celebrating “Humans of AI”: A Journey Into Public-Interest Technology\", \"Behold the First Realistic Depiction of the Human Face (Circa 25,000 BCE)\".",
"timestamp": "2026-03-02T19:12:17.046Z",
"articleCount": 10,
"topArticles": [
{
"title": "ENCATC Education and Research Sessions: Call for proposals",
"link": "https://www.echoes-eccch.eu/2026-encatc-education-and-research-sessions/"
},
{
"title": "Celebrating “Humans of AI”: A Journey Into Public-Interest Technology",
"link": "https://www.internetarchive.eu/2026/03/02/celebrating-humans-of-ai-a-journey-into-public-interest-technology/"
},
{
"title": "Behold the First Realistic Depiction of the Human Face (Circa 25,000 BCE)",
"link": "https://www.openculture.com/2026/03/behold-the-first-realistic-depiction-of-the-human-face-circa-25000-bce.html"
}
]
},
"Journalism + investigation": {
"summary": "Recent coverage in Journalism + investigation (10 articles from 5 sources) includes \"March 2026 Office Hours\", \"ProPublica Sues Education Department for Withholding Records About Discrimination in Schools\", \"Russia’s Information Grip on Ukraine’s Occupied Territories\".",
"timestamp": "2026-03-02T19:12:17.046Z",
"articleCount": 10,
"topArticles": [
{
"title": "March 2026 Office Hours",
"link": "https://www.datarescueproject.org/march26-officehours/"
},
{
"title": "ProPublica Sues Education Department for Withholding Records About Discrimination in Schools",
"link": "https://www.propublica.org/article/education-department-civil-rights-office-foia-lawsuit"
},
{
"title": "Russia’s Information Grip on Ukraine’s Occupied Territories",
"link": "https://euvsdisinfo.eu/russias-information-grip-on-ukraines-occupied-territories/"
}
]
},
"Digital skills + Citizen science": {
"summary": "Recent coverage in Digital skills + Citizen science (10 articles from 3 sources) includes \"Pool-Strategic 2025 – Sustaining Free Knowledge in Tshiluba and Kikongo\", \"A pause, not an end: Reflecting on WikiAfrica Hour’s journey in 2025\", \"Sesotho: A tale of two different orthographies\".",
"timestamp": "2026-03-02T19:12:17.046Z",
"articleCount": 10,
"topArticles": [
{
"title": "Pool-Strategic 2025 – Sustaining Free Knowledge in Tshiluba and Kikongo",
"link": "https://diff.wikimedia.org/2026/02/28/pool-strategic-2025-sustaining-free-knowledge-in-tshiluba-and-kikongo/"
},
{
"title": "A pause, not an end: Reflecting on WikiAfrica Hour’s journey in 2025",
"link": "https://diff.wikimedia.org/2026/02/28/a-pause-not-an-end-reflecting-on-wikiafrica-hours-journey-in-2025/"
},
{
"title": "Sesotho: A tale of two different orthographies",
"link": "https://diff.wikimedia.org/2026/02/27/sesotho-a-tale-of-two-different-orthographies/"
}
]
}
}
Loading