const albumlabel=document.getElementById("albumLabel"),albumart=document.getElementById("album-art"),song=document.getElementById("song"),artist=document.getElementById("artist"),album=document.getElementById("album");async function getLatestSong(){try{const t=await fetch("https://lastfm-last-played.biancarosa.com.br/aidxn_/latest-song");if(t.ok){const e=await t.json();e.track["@attr"]?e.track["@attr"].nowplaying?albumlabel.textContent="Now Playing:":(console.log("[WARN] Invalid value in now playing status, or something else messed up"),albumlabel.textContent="Last Listen:"):albumlabel.textContent="Last Listen:",albumart.src=e.track.image[1]["#text"],song.textContent=e.track.name,artist.textContent=e.track.artist["#text"],album.textContent=e.track.album["#text"]}else console.log(`Error: ${t.status}`)}catch(t){console.log(`Error: ${t.message}`)}}!async function(){await getLatestSong()}();