Last.Fm Records
See, the four albums I listened to the most since joining last.fm on March 3rd, 2004.
Last.Fm Records lets you show off your great musical taste. You can use it as a plugin or widget in Wordpress, or download the stand alone version for any other site.
The three images at the top of this article are there because I added
[ lastfmrecords | overall | 4 ]
(without the spaces) to this page. The plugin code will replace this with the images.
In the sidebar on your right you can see the plugin version. All the options are on the settings page for the plugin, except for the widget title.
The non-Wordpress version is a PHP5 class with some settings and one function to call. In the download you find a sample file that shows you how to use the class. You will have to check on this page if a new version is released.
Download
The plugin version is available at the Wordpress Plugins Directory.
Please note that, from version 1.4 and up, you need PHP5.
Run for cover
If you’re stuck with PHP4 and are brave, you could try my jQuery experiment Wordpress widget Run For Cover.
Download stand alone PHP class
The stand alone version has version number 1.0.3 and can be downloaded here. It has not been updated for the new last.fm API yet, so it’s got troubles at the moment (and people with a great site design are waiting).
The Wordpress theme on this site is
28 Jun 08 12 am
[...] the non-fail side: another plugin/widget puts my currently listened-to albums somewhere (with JavaScript look at the top edge of the screen, [...]
10 Jul 08 11 pm
[...] Last.Fm Records [...]
18 Jul 08 2 am
thanks for an awesome plugin! it’s still running on 2.6; but it won’t gather the last 3 months’ records, the only thing i can get to work is “last week” and it sometimes says “no images available.” Any plans on updating?
18 Jul 08 2 pm
thanks for the compliment! I’m always happy when users of the plugin are.
I’m working on a new version, and have re-written the caching system. If you have uploaded images yourself, it’s better to wait. If not, I can send you the test version, to see if that does it for you.
The only thing left is to convert the covers that have been uploaded from the plugin options page to the new filenames in the cache (if this doesn’t make sense to you, please ignore, it just means I have to write one more function before releasing this new version).
20 Jul 08 11 am
Great plugin, perhaps the best WP plugin I use. Also excited to hear there’s an update coming.
One request: Can it handle an empty feed differently? At the moment Last.fm’s Recent Tracks feed clears if you don’t listen to anything for a week. I’ve just come back from holiday, so my website is showing nothing here:
http://www.holster.co.uk/more
At the moment you can put a message in to show if it is empty, but can you specify a different feed instead?
For instance I’d like to always show recent tracks, but if there are no recent tracks I’d like to default to showing the last six months, so that there is never nothing shown.
Ideally, I’d like to always show the same number of covers, so if I show 6 covers and I only have 2 recent tracks to show, the remaining 4 are drawn from the alternative feed (ie the last six months)
Sound like a good idea?
Just a suggestion, great plugin, and if something like this were to be implemented, I would happily donate to the project!
®
20 Jul 08 4 pm
Hi, it’s great to see you are working on the next version! I’m running into the exact same problem as Josh - I can’t get the last three months (no images to display error is shown), though I can get Recent Tracks. I’m running WP 2.6. I’d be quite happy to test your next version. I don’t have any custom covers uploaded at the moment, so that won’t be a big deal.
Thanks!
20 Jul 08 6 pm
Jeroen –
First, thanks for the plugin. Way cool. I’m looking forward to the 1.4 beta so the images start showing up.
I did, however, find an interesting “packaging” issue for the plugin. The way you have your SVN structured, I got some puzzling results. Here’s why:
The main plugin directory is “last.fm”, which should be the highest-level folder in your distribution ZIP file. But instead, you wrapped the “last.fm” folder and your README file in a top-level folder called “lastfm-records”.
The result for me when I first installed it AUTOMATICALLY with Plugin Central (http://wordpress.org/extend/plugins/plugin-central/) is that the Settings page for your plugin was completely unavailable, but I could actually find a Widget. I configured it, and it found track names and displayed them as text.
THEN…I realized what was going on once I looked at my host via the terminal. I moved the “last.fm” directory up one level and removed the wrapper folder of “lastfm-records”. Now I could find the Settings menu once I got everything re-activated. Cool!
Anyway, I just wanted you to know since this might cause others some issues, especially if WP adds a future feature that provides auto-installing plugins from the Extend database in the future. This Plugin Developer FAQ entry might explain what’s going on:
http://wordpress.org/extend/plugins/about/faq/#subdirectory
Finally, I would suggest a move of the Last.FM Records config page OUT of the Plugins menu and INTO the Settings menu. This is more compliant with WP guidelines (http://codex.wordpress.org/Adding_Administration_Menus#Menus_and_Submenus), and also makes it easier to find for users.
OK, this sounds a bit critical, but really — this plugin is exactly what I’ve been looking for for a long time. Thanks a million.
20 Jul 08 6 pm
from me thanks, too! this is a great plugin. i have searched very long for a good last.fm plugin and now i have it. :-)
i have a little requestion. i have put the options of last.fm records to “recent tracks” and that work ok, but it refresh the list only each hour. i wish to put it all 10 minutes to refresh. can you help me, please?
20 Jul 08 6 pm
OK — one correction to the above. Your plugin did NOT actually do anything for me when it was buried down inside the wrapper directory “lastfm-records”.
It turns out, I got the working track info from the “Last.fm for Wordpress” plugin, which provides a very simple plugin with no options page. I got confused because the names were similar and the version numbers happened to be identical (1.3.1). Oops!
In short — while your plugin works as advertised if manually installed as outlined in your directions, it doesn’t work with the Plugin Central auto-installer due to the extra folder. Sorry for the confusion!
21 Jul 08 6 pm
I’m interested in trying out the test version. I’m having the same problem as Josh, and when I do get something to show up, it shows the album twice.
21 Jul 08 11 pm
Thanks to you all! It seems the current version of my plugin is performing pourly as a result of all the changes at last.fm, so I stopped sending out beta versions as it took most of the available time.
I’m working as fast as I can to release the new 1.4. I’ve installed it on a couple of my sites and it seems to work ok.
Wordpress will let you know when it’s available.
@Neil: good point, thanks. I’ll take a look at it for the next version.
@Richard: you’ll be pleased to know that this idea has been implemented in the upcoming version.
22 Jul 08 9 am
Thanks a lot Jeroen, I was kind of wondering what I was doing wrong since I installed your wonderful plugin yesterday, and all I was getting was this frustrating “No images to display” message.
Can’t wait to try the new version !
22 Jul 08 3 pm
Happy user here too! Can’t wait for you to get the new version sorted, thanks for the effort. :)
22 Jul 08 5 pm
Last.Fm Records…
This plugin shows cd covers on your Wordpress weblog. It connects to last.fm and grabs the list of cds you listened to recently and tries to find the cover images at last.fm. To speed things up, it only fetches these data once a day and keeps a local c…
22 Jul 08 11 pm
I really like your plugi, but the new 1.4. version causes the following fatal error:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in …/wp-content/plugins/last.fm/last.fm.php on line 17
23 Jul 08 12 am
@pasQualle: sorry, you need PHP5 on your server to use the new version of the plugin. If you get this message, you’re still on PHP4.
23 Jul 08 1 am
Hmm, tried to upgrade but I’m getting the same message as pasQualle so it’s broken for me. Thing is, my hosting account cPanel gives my PHP version as 5.2.6 so I’m not sure what I can do about it…
…if I have to go back to the older version, can I still download that? Thanks for the continued development!
®
23 Jul 08 2 am
Ok, thx. Good to know. Just change my .htaccess in the way my hoster told me, and now its working fine. Great!
23 Jul 08 4 am
Hey, just grabbed version 1.4 — thanks very much, it seems to work much better. More to play with tonight! :)
23 Jul 08 10 am
@Richard, that’s unexpected. I’ll mail you to see if we can find out what’s happening here.
The old version is broken, because of the changes on last.fm.
23 Jul 08 10 am
hey! first of: great addon, i love(d?) it.
when i did the update it also showed up with the error in line 17.
i did upgrade the server to php5, but the addon doesnt show up in the list any more. deleted the folder, uploaded again.. nothing (also not in the deactivated-list).
u have any hint?
23 Jul 08 10 am
Got it working after I upgraded to PHP 5, thanks!!
23 Jul 08 12 pm
php5? Bye.
23 Jul 08 7 pm
Jeroen, did the plugin not use to have words and album titles as well? I liked that feature - did you do away with it?
23 Jul 08 8 pm
@E(mm): you’re right, it did. As I was receiving a lot (and I mean A LOT) of mail telling me the plugin wasn’t working anymore since last.fm changed its site, I rushed out this new version. To do so, I had to disable some old stuff as it got in the way.
I made a todo list and plan to add the items in the next releases.
25 Jul 08 7 pm
ah… uploaded it again, now it works again ;)
keep up the great work =)
25 Jul 08 11 pm
An update of the standalone version would be greatly appreciated.
26 Jul 08 3 pm
The new version works perfectly, and with the new functionality is exactly what I wanted when I first installed the last version. Thanks for releasing it so quickly.
For those who have issue with PHP 5, you should be upgrading as that release has been out for a long time, is stable and more secure. Plus the PHP dev team announced that support for PHP 4 ended as of the last day of 2007. If your host hasn’t upgraded, or hasn’t set you up with an option to easily switch from 4 to 5, now may be a good time to reevaluate that.
Thanks again Jeroen, your plugin rocks!
26 Jul 08 11 pm
Jeroen Love the plug-in, any way to get it to display band and album name next to the cover art?
26 Jul 08 11 pm
@Tevaburns, I’ll post an update on my front page, as I just sent version 1.4.1 to wordpress.
27 Jul 08 10 pm
Thanks for the plugin, longtime user, but I can’t seem to get covers for the “last week” period with 1.4.1. Any ideas on that. Josdigital is my last.fm name and josdigital.com is my blog. Thanks.
27 Jul 08 10 pm
@Jos, if I go to your last.fm feed for last week, it is indeed empty. Sorry, can’t show something that last.fm doesn’t supply!
28 Jul 08 4 pm
Thanks for the reply Jeroen and thanks for all your efforts! It’s a stunning plugin - I think that is why it is so popular!
28 Jul 08 6 pm
Hi Jeroen,
Thanks for a wonderful plugin. I just have one question: I tried to change the settings of the plugin, but when I click on the Update button, it takes me back to the login page and asks me to login (eventhough I am already logged in). Even if I enter my password, it just keeps taking me back to the login page. Any ideas?
30 Jul 08 10 am
@Thornton: if the error is in my plugin I’d look for incorrect data submitted in the form, but I doubt that’s it. De you have non-alphanumeric characters in your last.fm username?
Otherwise I’d try another browser to see if that fixes your problem. Let me know if you need help with this!
30 Jul 08 12 pm
OK, all solved:
http://www.holster.co.uk/more
The plugin was giving me the line 17 error when I tried activating it, but this was because I was running PHP4 and the plugin now requires PHP5.
My web hosts still run PHP4 for compatibility, but PHP5 is also actually enabled, just not by default. I think a lot of hosting actually does this.
You can force a PHP script to use v5 if you use a .php5 extension instead of .php, problem is, WordPress can’t then actually see it so you can’t activate it. It only recognises .php files as plugins.
The answer that worked for me was to force my site to run on PHP5, by adding this line to the .htaccess file at the root of my site:
AddHandler application/x-httpd-php5 .php
This runs all PHP files sitewide in PHP5, including Last.fm Records, which means it works again and in my case, it hasn’t broken anything else.
Hope this helps anyone else with the same problem…
®
30 Jul 08 3 pm
I tried it on Safari, MSIE and Firefox. All return the same result. The wp-login.php page is constantly being called up when I try to update the settings, and it keeps asking me for my password.
Strangely, none of the other WP plugins I have installed are manifesting this problem. :-\
I’ll keep poking around. Maybe it’s just my site. LOL
01 Aug 08 4 am
[...] a plugin I made that displays images of a user’s top listened to artists. It basically Last.Fm Records but for artist instead of albums. You can check it out more at it’s project page. Posted [...]
02 Aug 08 6 pm
[...] Last.Fm Records This plugin shows cd covers on your Wordpress weblog. It connects to last.fm and grabs the list of cds you listened to recently and tries to find the cover images at last.fm. To speed things up, it only fetches these data once a day and keeps a local copy for the rest of the day. [...]
04 Aug 08 8 pm
Hello Jeroen,
I have pinpointed the problem.
For economical reasons, I am running several domains off of one hosting account using domain forcing through htaccess.
I had my WP settings set to:
http://www.bentspud.com/wp/ as the location of my WP installation
In reality, though, the WP folder is inside the bentspud folder of my htdocs (htdocs/bentspud/wp).
When I changed my WP settings to:
http://www.bentspud.com/bentspud/wp/
…I was able to update my LastFM settings successfully.
But now I am experiencing the login problem with the other plugins, etc.
Anyhoo, just thought I’d let you know.
06 Aug 08 2 pm
[...] good folks at 1and1 give you support for php 3-5, however 4 is the default. So, recently one of the plugins I use in my site upgraded to php 5 which forced me to continue using an older version. However, [...]
10 Aug 08 9 am
I just have one question, how do you change the Title of the Sidebar Widget from “last.fm records” to something else. I tried messing around with the .php file but to no avail was unsuccessful.
11 Aug 08 6 pm
The plugin is not working after last Last.fm update. I have tried to reinstall it, delete all the cache data and I am getting no error with silent output. I checked the cache directory and got there:
-rw-r–r– 1 apache apache 0 2008-07-26 23:07 cache
-rw-r–r– 1 apache apache 6 2008-08-11 18:24 70m45.08081118.recenttracks.list
-rw-r–r– 1 apache apache 6 2008-08-11 18:23 70m45.080811.3month.list
cat 70m45.080811.3month.list
a:0:{}
Think that permissions are fine, please could you try to help me?
12 Aug 08 10 am
Thanks for this awesome plugin, I’ve been using it for a while now on my sidebar. A quick question though:
I recently decided to show larger album covers, but for some reason the images it’s fetching from amazon are only 64px. So if I have my site showing 80px images, it stretches the small file and is unsightly. I see that your album covers are often over 100px, so why am I only getting tiny images?
14 Aug 08 6 am
[...] Last.Fm Records The Last.Fm Records plugin lets you show what you are listening to, with a little help from our friends at last.fm. [...]
15 Aug 08 1 pm
Question
For the WeeklyAlbumChart, do the “mbid” tags for the album have to be populated in order for the images to appear?
Because right now only those with mbid data show up, which are few.
Thanks
25 Aug 08 4 pm
Hey!
First of all: great script, thank you very much!!! The standalone version works for my just fine with PERIOD set to “recenttracks” or “weekly”…
As Jakub Steiner mentioned, an update of the standalone version would be greatly appreciated!!!
Thank you very much and keep up the good work!
Greetings
DRNKMNKY
25 Aug 08 10 pm
Ok, some catching up after my holidays:
@Thornton: thanks for adding your solution; I will try and find the reason for this error.
@Eric: the widget title is the only setting that is not on the options page. It can be set under Design >> Widgets and then selecting Last.Fm Records.
@Ady: are you using the last version of the plugin?
@Ashley: I went to your site and all the images from amazon seem to be 160px or bigger. Did it fix itself, or did you find a solution? Maybe it can help other people.
@Ben: the weekly period is the only data feed from last.fm that doesn’t have image information for the cds — very strange. This is why I have to use the mbid tag to find the correct image.
@DRNKMNKY: it’s in the process of being worked on!
27 Aug 08 12 pm
Somehow my post from last night didn’t make it into the blog. So here once again:
THNX Jeroen, I’ll check back soon to see if the new standalone version is finished.
I played around a little with 1.0.3 and the Template “CoverFlow” from “OrangeCD Catalog”. The result is support for “user.gettopalbums” or “library.getalbums” and the HTML output is a little more “styled” -> you can check it out under http://www.nexttry.com/last.fm
If you’re interested in the (very quick & dirty) PHP code, let me know i…