nelle-observer/astro/public/scripts/lastfm.js

10 lines
310 B
JavaScript
Raw Normal View History

2024-08-20 09:53:33 -06:00
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"]}`;
});