Last.fm Recent Album Artwork Plugin
My blog is now running a WordPress plugin that shows the album covers from Last.fm of songs I've recently listened to. There's a lot of plugins out there, but none that I found that did the job of getting the artwork, and certainly not for the most recent albums.
Download the Last.fm recent album artwork plugin
Last.fm Integration
You'll need a Last.fm account and the iScrobbler running to store the recent tracks at Last.fm. To check, you can view the recent tracks feed changing remysharp to your Last.fm username.
Installing
Download the Last.fm recent album artwork plugin and save it in your plugins directory (usually located in wp-content).
Then activate the plugin from the Plugins tab in your WordPress admin tools.
Setup
Through the Options -> Last.fm Recent Albums tab fill out the required fields.
Album Art Cache Settings
You must ensure the directory that you point the plugin to is writable. You can use either full or relative paths for the album artwork.
For example, my album artwork is located at http://remysharp.com/albums/, so my URL is set to:
/albums/
Within my WordPress set up, this is physically located in /home/remy/remysharp.com/htdocs/albums/, but I've set the path to be relative in the settings, so it reads:
albums/
Since the root of my WordPress installation is /home/remy/remysharp.com/htdocs/ this works just fine.
Adding to your Blog
Once the setup is complete, use the get_lastFM_album_artwork() function to add the album artwork to you blog. My blog adds the code as follows (with the setup wrapping the elements with li)
<?php if (function_exists('get_lastFM_album_artwork')) { ?>
<div class="lastfm">
<h3>Recent Albums</h3>
<ul>
<?php
get_lastFM_album_artwork();
?>
</ul>
</div>
<?php } ?>
Behind the Scenes
Behind the scenes the code will only show album artwork if Last.fm have the album associated (there's a number of tracks that don't have that information linked). If there's not enough recent tracks from the feed, the plugin will fill the rest of the albums based on the recently played albums (using timestamps from the artwork files).
The plugin will also avoid showing the same album cover twice.
Problems?
If you have any problems or suggestions or questions about the plugin, please let me know and I'll do my best to help.
You should follow me on Twitter here I'll tweet about JavaScript, HTML 5 and other such gems (amongst usual tweet-splurges)
I am having the same problem as Dale in comment #25. Trying to activate the plug-in. Dunno re: php4 or 5.
I'm still having the same problem with the title being displayed but not artwork or album information at all - just white space.
I've set the following parameters:
URL: http://website.co.uk/lastfm/
Full Path: /home/users/website.co.uk/lastfm/
The above directory I've done and chmod on to 777 and checked this a million times. I've entered in my correct lastfm account details and double checked this but I still get nothing.
What's going wrong?
This plugin looks great, but I'm stuck with php4 and can't use it, I keep getting an error
Hi,
I'm still having the same problems I noted earlier this month with regard to this plugin. Can you suggest how I may resolve them? The plugin page on Wordpress says to come here to get problems resolved. I'd just really like to get it working.
Thanks
Hi there,
any news on sorting the following error....
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/daleanth/public_html/blog/wp-content/plugins/lastfm_albums_artwork.php on line 158
I have php 4.4.7 installed on my server
pleeasee help
stu
I installed the plugin and followed the instructions, but now the plugin is not displaying anything. I probably just missed a little detail. The path for the URL is: http://www.jasoncypret.com/lastfmArt/
Full path: lastfmArt/
The folder has been created and is set to 777.
-JC
It's working now. Now I just gotta figure out why the URL's are going to a 404 page.
Thanks, it's a great plugin!
-JC
[...] Plugin Homepage [...]
[...] Last.FM Recent Albums and Artwork - Displays my most recently played albums from Last.FM with album artwork covers in a highly customizable fashion. Caches them on the site to decrease loading time from image sources. [...]
Many thanks, great plugin, works great with wordpress 2.5 and latest K2 aswell!!
TIP: if anyone has hosting with both php4 AND php5, but default on php4, you can put "SetEnv DEFAULT_PHP_VERSION 5" in an .htaccess file in your root and it will default to PHP5.
Hi!
Thanks for your great plugin, it really rocks! Just one thing: I've figured out that $url now has to be ..blabla..artist/_/track and NOT artist/album/track.
After changing it in the code everything works like a charm! Congrats.
Hi!
My goodness, I don't understand. I give up...
I installed the plugin and followed the instructions with tchmod on to 777 but "Album path must exist and be read/write permissions (/home/gwen-gwen/www.bloguenotes.com/album/)" Arrgh !!!
What's going wrong? Full path?!?
By advance, thanks
[...] Last.fm Recent Albums and Artwork by Remy Sharp [...]
[...] Last.fm Recent Albums and Artwork by Remy Sharp [...]
Hey Remy,
I've just moved to a new server, everything seems to be working fine apart from the album artwork plugin is giving me an error:
Warning: touch() [function.touch]: Utime failed: Permission denied in /home/daleanth/public_html/wp-content/plugins/lastfm_albums_artwork.php on line 187
I've had a look at the permissions and they all seem to be right. I've also tried de-activating and re-activating the plugin with no luck. Any ideas what else could be causing this?
Cheers!
Dale.
@Dale - I'm pretty sure it's still a permissions issue.
When you run
ls -ltrFaon the directory with the images - what do you get?I just tried creating a new directory which seems to have fixed the problem
Cheers.
[...] Last.fm Recent Album Artwork 这个WordPress插件显示最近在Last.fm听的歌曲的专辑封面。 [...]
Hi, I'm using your amazing plugin but I noticed there's something wrong. Covers that appear on my site are not those appearing on the audioscrobbler (lats.fm software)...
Am I wrong or what?
[...] Last.fm Recent Album Artwork [...]