nelle-observer/public/scripts/lastfm.js

8 lines
304 B
JavaScript

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