We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b90881c commit d6ccbc7Copy full SHA for d6ccbc7
1 file changed
assets/js/News.js
@@ -0,0 +1,27 @@
1
+const ticker = document.getElementById("ticker");
2
+
3
+// FIXED RSS (The Verge)
4
+const RSS_URL = "https://www.theverge.com/rss/index.xml";
5
6
+async function loadNews() {
7
+ try {
8
+ const api = `https://api.rss2json.com/v1/api.json?rss_url=${encodeURIComponent(RSS_URL)}`;
9
10
+ const res = await fetch(api);
11
+ const data = await res.json();
12
13
+ if (!data.items) return;
14
15
+ const feed = data.items.slice(0, 8).map(item => {
16
+ return `[${item.title.toUpperCase()}]`;
17
+ }).join(" • ");
18
19
+ ticker.textContent = feed + " • " + feed;
20
21
+ } catch (err) {
22
+ ticker.textContent = "NEWS OFFLINE • SYSTEM RUNNING LOCAL MODE";
23
+ }
24
+}
25
26
+loadNews();
27
+setInterval(loadNews, 600000);
0 commit comments