Wailt (what am I listening to?)

Wailt stands for "what am I listening to" and is a service which provides the answer to that exact question. It uses the Spotify API and the /spotify page uses this service to fetch the current song I'm listening to.

Suprisingly, the most difficult part of this project is authenticating with Spotify, since there's no easy way to have a long lasting access token for the server to use. Instead, you must use OAuth, which requires me to create an endpoint for authentication with Spotify, and access tokens only last one hour, which means the server must continually refresh access tokens every hour. If there is long period where it doesn't refresh the access token, the refresh token expires, requiring manual intervention from me re-authenticating with Spotify to get a new pair of tokens.

The source code is available on GitHub.


built by panulat v1.4 - Thu, 19 Dec 2024 14:17:23 GMT