mirror of
https://github.com/catmpeg/catmpeg.github.io.git
synced 2026-02-20 15:50:57 +03:00
ааа ето что
This commit is contained in:
parent
2d5fc8d406
commit
c8126250c8
2 changed files with 20 additions and 16 deletions
|
|
@ -1,13 +1,15 @@
|
|||
const lastPlayedBlock = document.getElementById('last-played');
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const lastPlayedBlock = document.getElementById('last-played');
|
||||
|
||||
fetch("https://lastfm-last-played.biancarosa.com.br/catmpeg/latest-song")
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data != 0) {
|
||||
const lastPlayed = document.querySelector("#song");
|
||||
lastPlayed.innerHTML = `<a target="_blank" href="${data.track.url}">
|
||||
${data.track.name} - ${data.track.artist["#text"]}</a>`;
|
||||
lastPlayedBlock.style.display = "block";
|
||||
}
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
fetch("https://lastfm-last-played.biancarosa.com.br/catmpeg/latest-song")
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data != 0) {
|
||||
const lastPlayed = document.getElementById("song");
|
||||
lastPlayed.innerHTML = `<a target="_blank" href="${data.track.url}">
|
||||
${data.track.name} - ${data.track.artist["#text"]}</a>`;
|
||||
lastPlayedBlock.style.display = "block";
|
||||
}
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue