mirror of
https://github.com/catmpeg/catmpeg.github.io.git
synced 2026-02-20 07:40:56 +03:00
привет сасет
This commit is contained in:
parent
cde3115249
commit
109a24432f
2 changed files with 12 additions and 17 deletions
11
assets/lastplayed.js
Normal file
11
assets/lastplayed.js
Normal 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";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue