Last.fm RPS Wordpress Plugin
Description : Its a widget plugin which collects data from Audioscrobbler web services and gets your last listened tracks and their album images. It works in PHP4 platforms and uses my simplexml class to collect data from Audioscrobbler.
Installation : The directory structure should be like this :
--> wp-plugins/ |-- lastfm_RPS/ |-- noart.gif |-- simplexml.class.php |-- readme.txt |-- lastfm.css
Then just activate the plugin, go to Design-Widgets, add the widget where you want, write the username and widget title in the settings and save. That’s all.
Note : If your theme isn’t widget enabled, you can insert this plugin in your sidebar.php file or wherever you want like this :
<h3>My Last.fm</h3>
<?php lastfm_recent_sidebar([username (required)],[list item count(default is 10)],[timezone diff in seconds(default is 0)])?>
</div>
Download : You can get the latest release here : http://wordpress.org/extend/plugins/lastfm-rps/
Demo : You can see a working example in my homepage.
Whats New in Version 0.2?
- Added option to define how many songs are displayed on the page
- Seperated css file from code and added new “lastfm.css” file
- Added different stylesheets to recently played songs
- Changed the datetime display configuration like “x days y seconds and z minutes ago”
- Changed the div’s into tables which are more reliable for different themes.
- If the user hasn’t any wp_head() included in his/her theme’s header.php, this script checks and adds its css itself.
Whats the fixes in Version 0.3?
- Added a neccessary fix for the time difference between server time and local time.
- If there is a track played in the player which length is less than 4 minutes ,the script showed two recently listened songs, so this is fixed now.It only displays one.
Whats new in Version 0.4?
- Added support for not widget-ready themes.
- Added Screenshot
- Updated Readme.txt
Whats the fixes in Version 0.5?
- When no songs played for a long time or only played only one song, this script raised errors. This is fixed now.
- Optimized the SimpleXML Extension for speed issues.
What’s added in v0.6?
- Improved checking of album images.
- If the feed item contains no album name, then directly shows default image.
What’s New in v0.7?
- Added image positioning
- Added optional Bottom Text
- Removed the slashes before ‘ and “
- Converted tables to css so you have all the control in lastfm.css
- Added artist images support. Now it shows artist images when it can’t find the album image.
People who looked at this item also looked at…
Related items

subscribe to our feed
























June 25th, 2009 at 17:23
[...] Now we just have to find the plugin that matches your needs. The one I’ve selected is rather boring-looking, but I like the simple displays. If you want the plugin to show album covers you could try Last.fm RPS Wordpress plugin: http://www.tahapaksu.com/wordpress/lastfm-wordpress-plugin [...]
June 6th, 2009 at 12:00
hello,
i get these result from your code:
“Parse error: syntax error, unexpected T_CLASS in /users/leiter/www/wordpress/test.php on line 2″
these are the phpinfo results:
SimpleXML
Simplexml support enabled
Revision $Revision: 1.151.2.22.2.45 $
Schema support enabled
after changing “simplexml.class.php” to “simplexml.php” in line 2 I get another pharse error.
“Parse error: syntax error, unexpected ‘:’ in /users/leiter/www/wordpress/test.php on line 4″
my php version is 5.2.8
Best Regards
June 6th, 2009 at 11:23
ok. lets try this. open an empty php file on your server and try this code :
include_once “simplexml.class.php”;
$sx = new simplexml;
$results = $sx->xml_load_file(”http://ws.audioscrobbler.com/1.0/user/felix-leiter/recenttracks.xml”);
echo “<pre>”;
print_r($results);
?>
June 5th, 2009 at 21:18
hello,
these are my the phpmyinfo from my hoster, which is bplaced.net.
XML Support active
XML Namespace Support active
libxml2 Version 2.6.32
XML-reader &-writer active
DOM/XML enabled
libXML support active
libXML Version 2.6.32
libXML streams enabled
i guess “XML support active” is what matters but it doesn’t work somehow.
best regards
June 5th, 2009 at 18:00
OK. The problem is about your server. Your username doesn’t cause any problems. Check if your server supports the standart PHP XML extension.
Create a php file and write this inside it:
< ?php echo phpinfo();?>
then upload it to your host and run that.look for the XML table and check if its active in the configuration list.
June 5th, 2009 at 17:46
no i tried the feed service and your feed seems to be active as usual. here it is :
http://ws.audioscrobbler.com/1.0/user/felix-leiter/recenttracks.xml
i’m looking at the code right now. i’ll post here if i find something.
June 5th, 2009 at 17:44
I receive an error when is use your plugin. my last.fm profilename is felix-leiter . if i activate the plugin as a widget i receive this error: “This username does not exist, or the feed service is down.” when i use an nonexisting username i also receive this error. is there an problem with the minus in my profilname or do i have to active the “feed service”? an if i have to, can you tell me where i have to do this.
best regards
felix
June 4th, 2009 at 12:52
@clay: you need to play with the lastfm.css file to adjust the width,height etc.. and for the badge thing, open lastfm.php and near the end you should see;
‘title’ => ‘Last.fm RPS’,
’size’ => 10,
’serversec’ => 0,
‘position’ => ‘left’,
‘text’ => ”,
’showbadge’ =>true,
‘badgeposition’ => ‘top’,
‘badgeoptions’ => ”
);
change these values to make it fit your needs.
June 4th, 2009 at 12:23
Hello, I’m trying to get the plugin integrated into my about page. My theme does not support widgets, and I’ve got the plugin on the page in the place where I want it, but the spacing and horizontal rules seem off. Can you point me in the right direction of what I need to change/delete to have everything line up properly? I also would like to remove the whole badge and just display the coverart, song title, artist, and time played. The screenshot that came along with the install file is very close to what I would like it to look like, or like Andrè’s http://www.beerdelirium.com/
I appreciate any help you can give me, and thank you for the wonderful plugin.
May 31st, 2009 at 17:38
Apologies Taha. I was messing around with another plugin at the same time.
Can you tell me how can I display the album art inline without the text, and how I can hide my profile information? Seems a bit complicated from the looks of it. All I want to show is album art, and the alt tags could display the information.. however at the moment it says “cover for..”. I have tried editing it, but to no avail.
May 30th, 2009 at 21:36
@aditya : I checked your site, and I think you are using a different plugin?
May 30th, 2009 at 19:36
Hi I am having a rather particular problem with my blog. I think I have already sent you a message about it before, but here goes anyway. The alt text displayed on the album art isn’t quite working correctly. Like I just listened to Guns N’ Roses - Chinese Democracy recently.. and it is showing the same album name for all the artists.
Can you please help? Thanks.
April 15th, 2009 at 10:25
New version has been released. Please backup your CSS file before updating.
April 10th, 2009 at 16:58
you should remove this lines
$albumimage = get_album_art(stripslashes($album->scalar),stripslashes($artist->scalar));
}else{
$replace = array(” “,”&”,”/”);
$with = array(”%20″,”%26″,”%2F”);
$artist = rawurlencode(utf8_encode(str_replace($replace,$with,stripslashes($artist))));
$album = rawurlencode(utf8_encode(str_replace($replace,$with,stripslashes($album))));
$albumimage = get_va_album_art($artist,$album);
}
and
echo ‘<a href=”‘.$feed->track->url.’” title=”Cover artwork for ‘.stripslashes(lastfm_recent_capitalize($track->name)).’”>’;
echo ‘<img src=”‘.$albumimage.’” alt=”Cover artwork for ‘.stripslashes(lastfm_recent_capitalize($feed->track->name)).’” />’;
echo ‘</a></p>’;
April 10th, 2009 at 16:55
But deleting lines 478 and 479 do remove the last.fm logo successfully.
April 10th, 2009 at 16:52
Thanks for the quick reply. I tried to delete even just the first part, and now my site doesn’t load, just white, but when the code is there, it loads.
April 10th, 2009 at 16:36
244 to 252 is for image loading
255 to 258 is for image showing
and line 478 is for the last.fm logo.
I didnt test them just looked and wrote here.
April 10th, 2009 at 16:23
G’day. Great plugin. Just wondering which lines of code would I remove so that it doesn’t load or display the album art? Also, which lines of code would I remove to remove the last.fm logo?
April 9th, 2009 at 15:30
Thanks for informing me about that. I’ll prepare an update with the 64px images added.
April 9th, 2009 at 15:27
First of all…great plugin. Offers so many more options than other Last.fm plugins for Wordpress.
One problem I found was that some of the thumbnails were not appearing on my list. After a little digging I found that Last.fm doesn’t seem to use the 50px wide images on the site any more so they are presumably not updated.
The 64px wide image is used extensively though so I changed the plugin code to search this folder for images and it now works fine!
Change “50″ to be “64s” on line 115 of lastfm.php
Thanks