main #8

Closed
limepotato wants to merge 183 commits from main into blog-drafts
4 changed files with 12 additions and 15 deletions
Showing only changes of commit 9cced65e87 - Show all commits

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/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"];
});