Show HN: PowerSong, a platform to see which songs make you run or ride faster
The backend is based on Python, with Django as the "MVC" framework, NumPy and Scipy, Spotipy. Celery is used to retrieve information from the APIs asynchronously.
The main challenges when building PowerSong was how to transform the raw information from Strava into "clean" pace, heartrate and elevation information that perfectly correspond to the period of time:
* GPS data is very noisy: decreases in GPS precision leads to spikes in the user position. I had to filter out songs that have large accelerations and speeds;
* Dealing with differences and speed (meters/sec) and pace (minutes/km) is a fun surprise: to calculate a difference in speed, you just have to subtract them. But if you want to compute the same difference in terms of pace, you cannot grab the speed difference in m/s and convert it to minutes/km; you have to have to compute the difference with the speed in minutes/km;
* The last.fm and Spotify only give you information regarding when the song you are listening started/ended. Pausing and skipping songs can lead to ambiguous situations;
* The same song can have different duration in different albums and versions (e.g. single version, album version). This is a bigger problem on last.fm, as songs are associated to multiple albums, which means that it can be impossible to find which version of the song was listened (this is still a WIP);
* Celery's per task rate limiting sounds nice, until you realize that you have multiple tasks using the same API, and thus, not counting towards the rate limit. I had to create per API tasks (spotify_task...) that encompass all methods and have a well behaved rate limited system;
Go to https://powersong.run/demo/ for a live demo using real data.
0 comments
[ 3.0 ms ] story [ 9.4 ms ] threadNo comments yet.