mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
fix: news not loading
This commit is contained in:
@@ -80,6 +80,7 @@
|
|||||||
"dompurify": "^3.2.4",
|
"dompurify": "^3.2.4",
|
||||||
"embla-carousel-autoplay": "^8.5.2",
|
"embla-carousel-autoplay": "^8.5.2",
|
||||||
"embla-carousel-svelte": "^8.5.2",
|
"embla-carousel-svelte": "^8.5.2",
|
||||||
|
"events": "^3.3.0",
|
||||||
"fuse.js": "^7.1.0",
|
"fuse.js": "^7.1.0",
|
||||||
"idb": "^8.0.2",
|
"idb": "^8.0.2",
|
||||||
"localforage": "^1.10.0",
|
"localforage": "^1.10.0",
|
||||||
|
|||||||
+16
-11
@@ -19,20 +19,25 @@ const rssFeedsByCountry: Record<string, string[]> = {
|
|||||||
"https://www.npr.org/rss/rss.php",
|
"https://www.npr.org/rss/rss.php",
|
||||||
],
|
],
|
||||||
taiwan: [
|
taiwan: [
|
||||||
"https://focustaiwan.tw/rss",
|
"https://news.ltn.com.tw/rss/all.xml",
|
||||||
"https://www.taipeitimes.com/rss/all.xml",
|
"https://www.taipeitimes.com/xml/index.rss",
|
||||||
"https://international.thenewslens.com/rss",
|
"https://international.thenewslens.com/rss",
|
||||||
],
|
],
|
||||||
hong_kong: [
|
hong_kong: [
|
||||||
"https://news.rthk.hk/rthk/en/rss.htm",
|
"https://rthk9.rthk.hk/rthk/news/rss/e_expressnews_elocal.xml",
|
||||||
"https://www.scmp.com/rss/91/feed",
|
"https://www.scmp.com/rss/91/feed",
|
||||||
],
|
],
|
||||||
panama: [
|
panama: [
|
||||||
"http://www.panama-guide.com/backend.php",
|
"https://critica.com.pa/rss.xml",
|
||||||
|
"https://www.panamaamerica.com.pa/rss.xml",
|
||||||
|
"https://noticiassin.com/feed/",
|
||||||
|
"https://elcapitalfinanciero.com/feed/"
|
||||||
],
|
],
|
||||||
canada: [
|
canada: [
|
||||||
"https://www.cbc.ca/cmlink/rss-topstories",
|
"https://www.cbc.ca/cmlink/rss-topstories",
|
||||||
"https://www.theglobeandmail.com/?service=rss",
|
"https://calgaryherald.com/feed",
|
||||||
|
"https://ottawacitizen.com/feed",
|
||||||
|
"https://www.montrealgazette.com/feed"
|
||||||
],
|
],
|
||||||
singapore: [
|
singapore: [
|
||||||
"https://www.straitstimes.com/news/singapore/rss.xml",
|
"https://www.straitstimes.com/news/singapore/rss.xml",
|
||||||
@@ -43,20 +48,16 @@ const rssFeedsByCountry: Record<string, string[]> = {
|
|||||||
"https://www.theguardian.com/uk/rss",
|
"https://www.theguardian.com/uk/rss",
|
||||||
],
|
],
|
||||||
japan: [
|
japan: [
|
||||||
"https://www.japantimes.co.jp/feed/topstories.xml",
|
|
||||||
"https://www3.nhk.or.jp/nhkworld/en/news/feeds/",
|
"https://www3.nhk.or.jp/nhkworld/en/news/feeds/",
|
||||||
|
"https://news.livedoor.com/topics/rss/int.xml"
|
||||||
],
|
],
|
||||||
netherlands: [
|
netherlands: [
|
||||||
"https://www.dutchnews.nl/feed/",
|
"https://www.dutchnews.nl/feed/",
|
||||||
"http://feeds.nos.nl/nosnieuwsalgemeen",
|
"https://www.nrc.nl/rss/"
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function fetchNews(source: string, sendResponse: any) {
|
export async function fetchNews(source: string, sendResponse: any) {
|
||||||
const parser = new Parser();
|
|
||||||
let feeds: string[];
|
|
||||||
console.log('fetchNews', source)
|
|
||||||
|
|
||||||
if (source === "australia") {
|
if (source === "australia") {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
|
|
||||||
@@ -73,6 +74,10 @@ export async function fetchNews(source: string, sendResponse: any) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const parser = new Parser();
|
||||||
|
let feeds: string[];
|
||||||
|
console.log('fetchNews', source)
|
||||||
|
|
||||||
if (rssFeedsByCountry[source.toLowerCase()]) {
|
if (rssFeedsByCountry[source.toLowerCase()]) {
|
||||||
// If the source is a country, fetch from predefined feeds
|
// If the source is a country, fetch from predefined feeds
|
||||||
feeds = rssFeedsByCountry[source.toLowerCase()];
|
feeds = rssFeedsByCountry[source.toLowerCase()];
|
||||||
|
|||||||
Reference in New Issue
Block a user