This commit is contained in:
nelle 2024-08-20 09:53:33 -06:00
parent 810e0ad8a4
commit 9cced65e87
4 changed files with 12 additions and 15 deletions

View file

@ -0,0 +1,9 @@
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"]}`;
});

View file

@ -1,8 +1,8 @@
<!-- optimized -->
<script src="../scripts/lastfm.js"></script>
<script src="../scripts/sound.js"></script>
<!-- unoptimized -->
<script is:inline src="/scripts/ntfy.js"></script>
<script is:inline src="/scripts/sga.js"></script>
<script is:inline src="/scripts/sga.js"></script>
<script is:inline src="/scripts/lastfm.js"></script>
<script is:inline src="/scripts/sound.js"></script>

View file

@ -1,12 +0,0 @@
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"];
});