You will need to have a Last.fm account to use.
Create an AccountYou will need to have access to the Last.fm API. Be sure to make a note of your API key.
Create an AppYou can do this by opening the desktop application and going to "Preferences". You will see a section with the heading "LAST.FM". Enter your username and password to give Spotify access. This is so Spotify can scrobble the songs you play to Last.fm.
$ bower install spotifyCurrentlyPlaying.js
$ npm install spotifyCurrentlyPlaying.js
<script src="https://npmcdn.com/spotifyCurrentlyPlaying.js/dist/spotifyCurrentlyPlaying.min.js"></script>
// Place this before the closing body tag
<script src="path/to/spotifyCurrentlyPlaying.min.js"></script>
// This will be used to display the Spotify widget
<div id="spotify-widget"></div>
// You will need to pass your parameters to the function
// You can initialize it with SCP() or SpotifyCurrentlyPlaying()
SCP({
selector: '#spotify-widget',
username: 'kjbrum',
api_key: 'xxxxxxxxxxxxxxx',
width: '100%',
height: '370'
});