привет сасет

This commit is contained in:
catmpeg 2025-12-12 15:52:09 +03:00
commit 109a24432f
2 changed files with 12 additions and 17 deletions

11
assets/lastplayed.js Normal file
View file

@ -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 = "<a target=\"blank_\" href=\"" + lastParse["track"]["url"] + "\">" + lastParse["track"]["name"] + " - " + lastParse["track"]["artist"]["#text"] + "</a>";
lastPlayedBlock.style.display = "block";
}