Skip to content

endowzoner/Last.fm-Now-Playing-Widget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Last.fm Now Playing Widget

A jQuery plugin for showing the currently playing track on Last.fm

Using Last.fm Now Playing Widget

Requirements

The plugin requires jQuery, we recommend using the latest version. You also need to have a Last.fm API key.

Installation

  1. Add Required Scripts

Make sure you include jQuery before adding the plugin at the bottom of your HTML document

<script src="/scripts/vendor/jquery.js"></script>
<script src="/scripts/plugins/lastfmnowplaying.js"></script>
  1. Add a Template

Add a template into your HTML document as in the example below. This can appear anywhere on your web page and can contain any markup you'd like. The template makes use of a number of custom tags surrounded by {}'s. Each template must have it's own ID.

<script type="text/template" id="lastFmWidget">
	<div>{ track.artist }</div>
	<div>{ track.title }</div>
	<div>{ track.album }</div>
	<img src="{ track.image.medium }">
</script>
  1. Call Widget

The widget is called using the following in your main JavaScript file.

$('#lastFmWidget').lastfmNowPlaying({
	apiKey: 'YOUR-API-KEY',
	members: ['YOUR-LASTFM-USERNAME']
});

Be sure to update the apiKey and members options with your own information.

About

A jQuery plugin for showing the currently playing track on Last.fm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors