From 2749a3aa44ca0329d830f89dcbe668731ea585c5 Mon Sep 17 00:00:00 2001 From: jjanzen Date: Mon, 10 Feb 2025 17:28:49 -0600 Subject: get random entry --- scripts/cssa-webring.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/cssa-webring.js b/scripts/cssa-webring.js index f385d34..d4aa430 100644 --- a/scripts/cssa-webring.js +++ b/scripts/cssa-webring.js @@ -6,8 +6,11 @@ function load_random_site() { fetch(webring_all_url) .then((response) => response.json()) .then((obj) => { - const urls = obj; - console.log(urls); + const entries = obj; + console.log(entries); + + const entry = entries[Math.floor(Math.random() * entries.length)]; + console.log(entry); }); } -- cgit v1.2.3