sarsooxyz.hugo/content/posts/selector/index.md

25 lines
1.8 KiB
Markdown
Raw Normal View History

2022-08-29 17:18:21 +01:00
---
2022-09-20 17:08:19 +01:00
title: "Selector: A Spotify Listening Agent"
2022-08-29 17:18:21 +01:00
date: 2022-04-04T21:26:40+00:00
draft: false
2022-09-20 17:08:19 +01:00
aliases:
- /selector
2022-08-29 17:18:21 +01:00
---
![ci](https://github.com/sarsoo/Selector/actions/workflows/ci.yml/badge.svg)
I've been working on my .NET skills recently and, as I tend to, practiced with a tool that would integrate with my music listening habits.
Selector is an agent that watches what youre listening to on Spotify and reacts to changes by firing pluggable events. These include retrieving the current songs characteristics and play count on Last.fm. This information is displayed on a dashboard that updates live.
{{< figure src="dashboard.png" caption="The dashboard shows information from Spotify and Last.fm" alt="dashboard example" >}}
2022-08-29 17:18:21 +01:00
The app consists of a ASP.NET web app and a command line service that runs the listening agents. A Redis instance is used for cache and messaging between the nodes.
# Last.fm
[Last.fm](https://last.fm) is a service that records what you listen to to give stats and recommendations, Spotify can be linked to record your listening history. Selector includes an integration to present play count data for the current track along with its album and artist on the dashboard.
Along with this, a background agent can be configured in the web UIs settings to mirror your listening history to the local database in order to allow quicker, live statistics querying without constant network calls. This really adds to the data that can be presented live, Last.fm has a decent API, but querying a users entire history takes a while and seriously reduces the depth of insights that can be presented in real-time, especially as this dataset grows with time. By storing a copy locally, the whole history can be queried quickly.
Get deeper insights into what you listen to, [start here](https://selector.sarsoo.xyz).