diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7ec5434..aea55db 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,6 +17,8 @@ permissions: jobs: build: runs-on: ubuntu-latest + env: + LASTFM_KEY: ${{ secrets.LASTFM_KEY }} steps: - name: checkout uses: actions/checkout@v4 diff --git a/src/pages/index.astro b/src/pages/index.astro index 3684588..cf0eb70 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,6 +1,12 @@ --- import Layout from "../layouts/layout.astro"; import "../styles/main.scss"; + +const request = await fetch("http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=angelcube__&api_key=" + import.meta.env.LASTFM_KEY + "&limit=1&format=json"); +const response = await request.json().then(data => data.recenttracks.track[0]); +const artist = response.artist["#text"]; +const name = response.name; +const album = response.album["#text"]; --- @@ -16,6 +22,9 @@ import "../styles/main.scss";

beyond coding, I love to sing, do a little drawing, and obsess over video games—currently, I'm plagued by my love of Celeste.

+ + last played song: {name} by {artist} on {album} +