/ Hacks

Show the last played song on my page

So, I think its high time I get to putting few of ideas I had related to my music into action.

I have recently resumed scrobbling all the music I listen to last.fm. I use CloubScrob for my iPhone, Shazam on my Macbook, last.fm integration on my Spotify app and custom scripts here and there ...

Now, to show the last played song on my About me page, I used this script kjbrum/spotifyCurrentlyPlaying.js.

Getting it work is straight forward ..

  • Setup the markup on the page
<div id="spotify-widget"></div>
  • Call the script and include the API keys from last.fm
      $(function () {
        SCP('#spotify-widget', 'TheKiteRunner', 'XXXXXXXXXXXXXX', '100%', '300');
      });

That's it! You have the last played song in a neat box on your page!

Last played song from last.fm