jquery.ghostfm
A jQuery plugin for showing your recently scrobbled tracks from Last.fm
Screenshots
Installation
bower install --save jquery.ghostfm npm install --save jquery.ghostfm
Options
mode
Specify a mode for the widget
mode: minimal|card
Minimal mode
Shows the latest scrobbled track in a minimal widget
Card mode
Shows 50 of the user's recently scrobbled tracks
Note: If you want the card mode to be a specific size, set a width and height on the parent container. The widget will take up the full size of the parent.
card
If card mode is chosen, the following options are available
card: { bg: '', // background color for the widget, supports linear gradients list: { count: 50, // number of scrobbled tracks to fetch (default 50, max 200) showImg: true, // show image for the track showTime: true, // show time for the track } }
autoRefresh
Enable auto-refresh of the widget (minimum refresh rate is 1 minute)
autoRefresh: { enabled: true, every: 60000 // time in ms }
eq
Equalizer image and whether to show it or not
eq: { src: '', // source url or base64 URI show: true }
user
Last.fm username
user: 'KTheListener'
cssClass
Custom CSS Class to style the widget
cssClass: 'custom-class'
apiKey
Last.fm API key
apiKey: 'INSERT_LASTFM_API_KEY_HERE'
container
Attach the widget to a container on the page
container: '.custom-container'
Example
new $.ghostfm({ eq: { src: '<img_src_here>', show: true }, mode: 'card', card: { bg: 'linear-gradient(to right, #43c6ac, #f8ffae)', list: { count: 10, showImg: true, showTime: false } }, apiKey: '', cssClass: 'custom-class', user: 'KTheListener', container: '.custom-container' });
Support
For any issues/queries, please open a new Github Issue.
License
MIT