diff --git a/public/scripts/lastfm.js b/public/scripts/lastfm.js new file mode 100644 index 0000000..8df8a4f --- /dev/null +++ b/public/scripts/lastfm.js @@ -0,0 +1,9 @@ +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']; + }); \ No newline at end of file diff --git a/src/pages/index.astro b/src/pages/index.astro index 8cf4e6f..4f8744f 100755 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -11,7 +11,7 @@ import Layout from "../layouts/Layout.astro";

Welcome to my weird little spot of the internet :3


-
+
+
+ +
+ latest played song on last.fm + powered by @biancarosa/lastfm-last-played +
+
+

About The Me