From 77bb6a545f7830d943132199e0073deef4aee508 Mon Sep 17 00:00:00 2001
From: jjanzen <jjanzen@jjanzen.ca>
Date: Mon, 10 Feb 2025 17:37:35 -0600
Subject: try cleaning array

---
 scripts/cssa-webring.js | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

(limited to 'scripts/cssa-webring.js')

diff --git a/scripts/cssa-webring.js b/scripts/cssa-webring.js
index eb59c08..8f0a0c4 100644
--- a/scripts/cssa-webring.js
+++ b/scripts/cssa-webring.js
@@ -1,18 +1,19 @@
 function load_random_site() {
-    console.log("requested random site");
-
     const webring_all_url = "https://aidang.cc/webring/all";
 
     fetch(webring_all_url)
         .then((response) => response.json())
         .then((obj) => {
-            const entries = obj;
-            console.log(entries);
-
+            const entries = obj; // TODO: remove myself from the list
+            const entries_cleaned = obj.filter((item) => {
+                return !item.equals({
+                    name: "jjanzen's website",
+                    url: "https://jjanzen.ca",
+                });
+            });
+            console.log(entries_cleaned);
             const entry = entries[Math.floor(Math.random() * entries.length)];
-            console.log(entry);
-
-            window.location.href = entry.url;
+            // window.location.href = entry.url;
         });
 }
 
-- 
cgit v1.2.3