Upload files to "website/news"

This commit is contained in:
2026-01-19 15:06:37 +00:00
parent 76aac92fc5
commit 5db462d9cb
4 changed files with 558 additions and 0 deletions

116
website/news/feeds.js Normal file
View File

@@ -0,0 +1,116 @@
/* feeds.js
Configure feeds + regions here.
*/
(function () {
// CORS NOTE:
// Browsers usually cannot fetch https://news.google.com/rss... directly due to CORS.
// Default uses allorigins (raw mode). You can swap to your own proxy.
//
// Examples:
// "" (no proxy; only works if YOUR server adds CORS headers or proxies it)
// "https://api.allorigins.win/raw?url="
// "https://r.jina.ai/http://YOUR_HTTP_PROXY/" (if you host a proxy)
//
window.NEWS_PROXY_BASE = "https://api.allorigins.win/raw?url=";
// Feed list (adding entries here automatically adds them to the dropdown)
// type:
// - "top" -> https://news.google.com/rss?... (Top headlines)
// - "topic"-> https://news.google.com/rss/headlines/section/topic/{TOPIC}?... (Topic feeds)
window.NEWS_FEEDS = [
{ id: "top", label: "Top", type: "top" },
{ id: "world", label: "World", type: "topic", topic: "WORLD" },
{ id: "nation", label: "Nation", type: "topic", topic: "NATION" },
{ id: "business", label: "Business", type: "topic", topic: "BUSINESS" },
{ id: "technology", label: "Technology", type: "topic", topic: "TECHNOLOGY" },
{ id: "entertainment", label: "Entertainment", type: "topic", topic: "ENTERTAINMENT" },
{ id: "sports", label: "Sports", type: "topic", topic: "SPORTS" },
{ id: "science", label: "Science", type: "topic", topic: "SCIENCE" },
{ id: "health", label: "Health", type: "topic", topic: "HEALTH" }
];
// Regions (gl/hl/ceid).
// Add more entries and they show up automatically.
window.NEWS_REGIONS = [
// ---- North America / default English ----
{ id: "US_EN", label: "United States (English)", hl: "en-US", gl: "US", ceid: "US:en" },
{ id: "US_ES", label: "United States (Spanish)", hl: "es-US", gl: "US", ceid: "US:es-419" },
{ id: "CA_EN", label: "Canada (English)", hl: "en-CA", gl: "CA", ceid: "CA:en" },
{ id: "CA_FR", label: "Canada (French)", hl: "fr-CA", gl: "CA", ceid: "CA:fr" },
// ---- UK / Ireland ----
{ id: "GB_EN", label: "United Kingdom (English)", hl: "en-GB", gl: "GB", ceid: "GB:en" },
{ id: "IE_EN", label: "Ireland (English)", hl: "en-IE", gl: "IE", ceid: "IE:en" },
// ---- Europe (supported Google News editions) ----
{ id: "AT_DE", label: "Austria (Deutsch)", hl: "de-AT", gl: "AT", ceid: "AT:de" },
{ id: "BE_FR", label: "Belgium (Français)", hl: "fr-BE", gl: "BE", ceid: "BE:fr" },
{ id: "BE_NL", label: "Belgium (Nederlands)", hl: "nl-BE", gl: "BE", ceid: "BE:nl" },
{ id: "BG_BG", label: "Bulgaria (Български)", hl: "bg-BG", gl: "BG", ceid: "BG:bg" },
{ id: "CH_DE", label: "Switzerland (Deutsch)", hl: "de-CH", gl: "CH", ceid: "CH:de" },
{ id: "CH_FR", label: "Switzerland (Français)", hl: "fr-CH", gl: "CH", ceid: "CH:fr" },
{ id: "CZ_CS", label: "Czechia (Čeština)", hl: "cs-CZ", gl: "CZ", ceid: "CZ:cs" },
{ id: "DE_DE", label: "Germany (Deutsch)", hl: "de-DE", gl: "DE", ceid: "DE:de" },
{ id: "ES_ES", label: "Spain (Español)", hl: "es-ES", gl: "ES", ceid: "ES:es" },
{ id: "FR_FR", label: "France (Français)", hl: "fr-FR", gl: "FR", ceid: "FR:fr" },
{ id: "GR_EL", label: "Greece (Ελληνικά)", hl: "el-GR", gl: "GR", ceid: "GR:el" },
{ id: "HU_HU", label: "Hungary (Magyar)", hl: "hu-HU", gl: "HU", ceid: "HU:hu" },
{ id: "IT_IT", label: "Italy (Italiano)", hl: "it-IT", gl: "IT", ceid: "IT:it" },
{ id: "LT_LT", label: "Lithuania (Lietuvių)", hl: "lt-LT", gl: "LT", ceid: "LT:lt" },
{ id: "LV_EN", label: "Latvia (English)", hl: "en-LV", gl: "LV", ceid: "LV:en" },
{ id: "LV_LV", label: "Latvia (Latviešu)", hl: "lv-LV", gl: "LV", ceid: "LV:lv" },
{ id: "NL_NL", label: "Netherlands (Nederlands)", hl: "nl-NL", gl: "NL", ceid: "NL:nl" },
{ id: "NO_NO", label: "Norway (Norsk)", hl: "no-NO", gl: "NO", ceid: "NO:no" },
{ id: "PL_PL", label: "Poland (Polski)", hl: "pl-PL", gl: "PL", ceid: "PL:pl" },
{ id: "PT_PT", label: "Portugal (Português)", hl: "pt-PT", gl: "PT", ceid: "PT:pt-150" },
{ id: "RO_RO", label: "Romania (Română)", hl: "ro-RO", gl: "RO", ceid: "RO:ro" },
{ id: "RS_SR", label: "Serbia (Srpski)", hl: "sr-RS", gl: "RS", ceid: "RS:sr" },
{ id: "SE_SV", label: "Sweden (Svenska)", hl: "sv-SE", gl: "SE", ceid: "SE:sv" },
{ id: "SI_SL", label: "Slovenia (Slovenščina)", hl: "sl-SI", gl: "SI", ceid: "SI:sl" },
{ id: "SK_SK", label: "Slovakia (Slovenčina)", hl: "sk-SK", gl: "SK", ceid: "SK:sk" },
{ id: "UA_UK", label: "Ukraine (Українська)", hl: "uk-UA", gl: "UA", ceid: "UA:uk" },
{ id: "UA_RU", label: "Ukraine (Русский)", hl: "ru-UA", gl: "UA", ceid: "UA:ru" },
{ id: "TR_TR", label: "Turkey (Türkçe)", hl: "tr-TR", gl: "TR", ceid: "TR:tr" },
// ---- Russia ----
{ id: "RU_RU", label: "Russia (Русский)", hl: "ru-RU", gl: "RU", ceid: "RU:ru" },
// ---- Asia ----
{ id: "JP_JA", label: "Japan (日本語)", hl: "ja-JP", gl: "JP", ceid: "JP:ja" },
{ id: "KR_KO", label: "Korea (한국어)", hl: "ko-KR", gl: "KR", ceid: "KR:ko" },
{ id: "CN_ZH", label: "China (简体中文)", hl: "zh-CN", gl: "CN", ceid: "CN:zh-Hans" },
// ---- India ----
{ id: "IN_EN", label: "India (English)", hl: "en-IN", gl: "IN", ceid: "IN:en" },
{ id: "IN_HI", label: "India (हिन्दी)", hl: "hi-IN", gl: "IN", ceid: "IN:hi" },
];
window.NEWS_DEFAULT_FEED_ID = "top";
window.NEWS_DEFAULT_REGION_ID = "US";
})();