nelle-observer/public/scripts/lastfm.js
2024-08-10 01:57:22 -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"];
});