On the bottom right of this website is a small list entitled "What I'm listening to". What it does is very simple, any time I listen to a track on my phone or PC then that track, artist, album and album cover is added to the list all linked up to listen to it on last.fm.
Read on if you want to know how to do this on your own site because it's very simple!
By the way, if you find a better way to do this or update the script to be better then comment below.
First, get yourself a last.fm account as that is what we'll be using to get the track from your place of listening to the web. Now install the software anywhere you listen to music so on your PC, phone, shoe, eye, what ever. There is a version for most things including Windows and Android.
Now get yourself an api key here
Now, to add it to Drupal:
{syntaxhighlighter brush: as3;fontsize: 100; first-line: 1; }<script type="text/javascript" src="/js/lastfm.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('div#lastfm').lastFM({ username: 'YOUR USERNAME', apikey: 'YOUR API KEY', number: 3, artSize: 'medium', noart: 'images/noartwork.gif', onComplete: function(){ //Done } }); }); </script> <div id="lastfm"> <dl> <dt class="lfm_art"> <a href="#"></a> </dt> <dd class="lfm_song"></dd> <dd class="lfm_artist"></dd> <dd class="lfm_album"></dd> </dl> </div> {/syntaxhighlighter}
Contact me here or catch me on one of
the social networks below
Try this on your mobile
You should be able to use this right from the screen
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
|
|
|
|
|
|
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
|
|
|
|
|
Copyright David Slack - Web developer