limepot-xyz/public/scripts/lastfm.js
2024-07-13 00:03:34 -06:00

12 lines
353 B
JavaScript

let user = "limepotato";
let url =
"https://lastfm-last-played.biancarosa.com.br/" + user + "/latest-song";
let song = document.querySelector("#song");
fetch(url)
.then(function (response) {
return response.json();
})
.then(function (json) {
song.innerHTML =
json["track"]["name"] + " - " + json["track"]["artist"]["#text"];
});