About This Site

This site was made with Next.js and Tailwind! The colors were generated using HueWind. The source code is available here.

Music Player Widget

The music player widget on the homepage is powered by recenttrack, a Vercel serverless function I wrote. It attempts to request the currently playing song from the Spotify API, through an app I have registered under my Spotify developer account.

There's a problem though: because the Spotify API response has an isPlaying flag, it might seem as though the endpoint effectively returns the most recently played song. But this is not the case—the endpoint returns no data after a certain time has passed since Spotify was last playing. To remedy this, I utilize the last.fm API to query my most recently logged song, which has the quirk that it only logs a song after at least half of the song has been played. But that's good enough.