From d8290950846b463c08abcf67bfd317cb91166b53 Mon Sep 17 00:00:00 2001 From: EduardSkibidiEdger Date: Tue, 7 Jan 2025 10:58:52 +0200 Subject: [PATCH] sadf --- count.html | 1 + index.html | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 count.html diff --git a/count.html b/count.html new file mode 100644 index 0000000..2691d02 --- /dev/null +++ b/count.html @@ -0,0 +1 @@ +tba \ No newline at end of file diff --git a/index.html b/index.html index 6d2dcaa..fccfc2f 100644 --- a/index.html +++ b/index.html @@ -210,8 +210,8 @@

Last played song


+

You're visitor #0

- @@ -303,6 +303,30 @@ document.getElementById('favicon').href = newIcon; }); }); + // Function to fetch the visitor count from the API + async function fetchVisitorCount() { + try { + // Make an API request + const response = await fetch('https://count.prigoana.com/prigoana.com/'); + + // If the response is successful, parse the response as text + if (response.ok) { + const visitorNumber = await response.text(); + // Display the visitor count in the span element with id 'visitorCount' + document.getElementById('visitorCount').innerText = visitorNumber; + } else { + // If the request failed, show an error message + document.getElementById('visitorCount').innerText = '0'; + } + } catch (error) { + // Handle any network or other errors + console.error('Error fetching visitor count:', error); + document.getElementById('visitorCount').innerText = '0'; + } + } + + // Call the function to fetch the visitor count when the page loads + fetchVisitorCount();