diff options
author | jjanzen <jjanzen@jjanzen.ca> | 2025-02-10 17:37:35 -0600 |
---|---|---|
committer | jjanzen <jjanzen@jjanzen.ca> | 2025-02-10 17:37:35 -0600 |
commit | 77bb6a545f7830d943132199e0073deef4aee508 (patch) | |
tree | 0286aefb126ce9c12a43ebdde7a58c359e45bc5d | |
parent | 3eb9d53772d24b270d23452a41fdc185b99b6ab2 (diff) |
try cleaning array
-rw-r--r-- | scripts/cssa-webring.js | 17 |
1 files changed, 9 insertions, 8 deletions
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; }); } |