From 109a24432f617df520e2306c987fcd4acdde01f0 Mon Sep 17 00:00:00 2001 From: xelframe Date: Fri, 12 Dec 2025 15:52:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=B8=D0=B2=D0=B5=D1=82=20=D1=81?= =?UTF-8?q?=D0=B0=D1=81=D0=B5=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/lastplayed.js | 11 +++++++++++ index.html | 18 +----------------- 2 files changed, 12 insertions(+), 17 deletions(-) create mode 100644 assets/lastplayed.js diff --git a/assets/lastplayed.js b/assets/lastplayed.js new file mode 100644 index 0000000..5076da2 --- /dev/null +++ b/assets/lastplayed.js @@ -0,0 +1,11 @@ +const lastPlayedBlock = document.getElementById('last-played'); +let xmlHttp = new XMLHttpRequest(); +xmlHttp.open("GET", "https://lastfm-last-played.biancarosa.com.br/catmpeg/latest-song", false); +xmlHttp.send(null); +if (xmlHttp.responseText != 0) { + const lastParse = JSON.parse(xmlHttp.responseText); + + const lastPlayed = document.querySelector("#song"); + lastPlayed.innerHTML = "" + lastParse["track"]["name"] + " - " + lastParse["track"]["artist"]["#text"] + ""; + lastPlayedBlock.style.display = "block"; +} \ No newline at end of file diff --git a/index.html b/index.html index d2dfe29..24e94e6 100644 --- a/index.html +++ b/index.html @@ -30,23 +30,7 @@

Latest played song:

- - +

> retro page <