TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: PowerSong, a platform to see which songs make you run or ride faster

3 点作者 amourao超过 6 年前
Do you that song that gets you running a little faster or your heart beat harder every time it plays? Ever wanted to apply statistics to check whether the effect was consistent? Here&#x27;s PowerSong!<p>The backend is based on Python, with Django as the &quot;MVC&quot; framework, NumPy and Scipy, Spotipy. Celery is used to retrieve information from the APIs asynchronously.<p>The main challenges when building PowerSong was how to transform the raw information from Strava into &quot;clean&quot; pace, heartrate and elevation information that perfectly correspond to the period of time:<p>* 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;<p>* Dealing with differences and speed (meters&#x2F;sec) and pace (minutes&#x2F;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&#x2F;s and convert it to minutes&#x2F;km; you have to have to compute the difference with the speed in minutes&#x2F;km;<p>* The last.fm and Spotify only give you information regarding when the song you are listening started&#x2F;ended. Pausing and skipping songs can lead to ambiguous situations;<p>* 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);<p>* Celery&#x27;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;<p>Go to <a href="https:&#x2F;&#x2F;powersong.run&#x2F;demo&#x2F;" rel="nofollow">https:&#x2F;&#x2F;powersong.run&#x2F;demo&#x2F;</a> for a live demo using real data.

暂无评论

暂无评论