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.
















56 Yorum Yapılmış, Yorum yapın yada Ping Bırakın
Hi!
I really like this plugin! I installed it yesterday and it worked fine. Today, I looked at my page and where the plugin should be I got this message:
“Warning: Invalid argument supplied for foreach() in /home/patra344/public_html/winb/wp-content/plugins/lastfm-rps/lastfm.php on line 66″
I don’t know any php, so I don’t know what to fix or change or anything. I would really appreciate any help you could offer.
Thank you!!
@Elizabeth: What’s your web page address? And if you can edit lastfm.php, please try to change :
to
Hi!
I made the change as you suggested, but it did not help
@Elizabeth: Ok. This happens when your feed is empty or includes only one song played. I’m going to fix it right now. When it’s finished, you can update your plugin from wordpress directory. Thanks.
is there a way to have the feed refresh like every 3 minutes?
@Mike: Do you mean caching? The plugin gets the updated feed everytime it loads
Hi, I really like this widget, it gives away the feeling of communication.
I have some questions & suggestions tough.
1) It would be nice if the widget would download artist images when there is no album cover availible. That would be very useful for some rare artists.
2) It would also be useful to add possiblity for users to add custom line of text on the bottom of the widget where they could place link to their last.fm page and a small disclamer in their own language.
3) Possibility to allign everything on the right side.
I hope this is not too much to ask
Great widget once again.
This is a great plugin, very well done! I just have one complaint…a plugin title or song/artist title that has an apostrophe shows up like this:
Ex. What I’/m Listening To
Old 97′/s
This also causes the album art to not show up if the song title or artist title has the apostrophe, even if it shows up fine in my last.fm stream. I hope this can be fixed!
Thanks again for such fine work. Looks great on my site.
@Topuz: I’ll add them to my todo list. Thanks for the suggestions
@Jess: The fix will be in next release. Thank you for showing me the point
The latest release is available for downloading! Go get it
Whenever I add the widget, after putting in my username as-is, the result on my blog is:
This username does not exist, or the feed service is down..
Another last.fm plugin is working fine (therefore reading the feed), and I’ve been trying this every day since last week. I don’t suppose you could even begin to know what I’m doing wrong?
@Emz: Yes i don’t know why it could be acting like this
Maybe your server doesn’t support XML reading?
I love this plugin but for some reason it is not formatting right at all in my sidebar! I’m still very new to WP so I’m clueless as to how it can be repaired. Any help would be great. Thanks!
@M: for the badge there is a value like %57. try to change it as it seems fit in your sidebar.
Hi there!
Unfortunately, I am having the same problem as ‘EMZ’. Since I installed the plugin, it has said nothing but ‘the user does not exist or the feed is down’. Last.fm is definitely working, I can read the XML file on their site. My host (DreamHost) does support XML, but I have done some digging and found that it does NOT support ‘function.file_get_contents’ … which I have found in your widget’s PHP file. So that’s the problem on my end, and I suspect that perhaps EMZ may be stuck in the same hard spot.
There is one topic on my host’s discussion forums about said problem, but it makes no sense to me as I am not a programmer. All it really says is to take a look at php.net’s cURL exec instructions and pay particular attention to #1: Fetching a Web Page.
So… that’s it. Doesn’t work on DreamHost without probably more tinkering than you would like to do. I so wish I could use this plugin - it’s very pleasing to the eye!
Well thank you for your feedback. But how can a web server don’t support file_get_contents
some hosts don’t support cURL and some dont support file_get_contents. I think i should add support of both systems. Thanks.
Hi
It’s user-friendly and it works nice.
I’ll follow this comments feed in case you know the answer 
First, I would like to thank you for such a great plug-in
I just wanted to know if it’s possible to remove the “profile” part of your plugin ? ’cause I just want to show the last played song, and not necessarly informations about when I registered on Last.fm, how many tracks I played etc …
Well, I finally managed to by editing the plug-in himself
Putting all the settings to false was still showing my name & status ( User ) so I deleted it from the root 
Thanks again for your plugin !
that should be working.. but if it works like that you can do whatever you want
The “This username does not exist, or the feed service is down.” happens on host running PHP5. Is that possible to get it work with it ?
@Kyotoweb: I don’t know what causes this error. Maybe it’s the same error with hosts which don’t support file_get_contents. In next release I will add a different get function. Tomorrow maybe.
@jocuri: Thanks for using it.
Hi there! I have exactly the same problem - “This username does not exist, or the feed service is down”. Would love to see a new version of the plugin that works on my blog like the other last.fm-plugins do - because your widget looks the best!
@beetFreeQ: ok. I’m checking it now.
please tell me if it displays the error again.
Selam,eklentiyi güncelledikten sonra bu hatayı veriyor…
Eklenti etkinleştirilemedi, çünkü önlenemeyen bir hataya sebep oldu.
Parse error: syntax error, unexpected T_RETURN in public_html/wp-content/plugins/lastfm-rps/simplexml.class.php on line 50
@Kerem: 1.0.0 versiyonunu dene. Yeni yükledim.
– New version has been released. the v0.9 was buggy.
Wow, that was a fast response! Well, unfortunately the problem is still there, after I updated to the new version (1.0.0)…
Here’s the phpinfo for my webspace at Greatnet.de - maybe it helps: http://web0.server87.greatnet.de/info.php
It’s me again! Maybe you could compare your way of retrieving the data from last.fm with the code of “last.fm Records” at http://dirkie.nu/projects/lastfmrecords/ - that plugin works with exactly the same last.fm-name. Oh, and by the way: My last.fm name is beetfreeq - maybe it has something to do with the name itself!
Well. The problem is solved I think. You can use the 1.0.1 version.
Yep, it’s solved now
- works very nice. Now, that I can use the plugin, I already have some ideas for new features, if you don’t mind
These are my suggestions:
- option to disable the stylesheet at all. That way I could have the styles in my layout-css rather than having to change the plugin-css itself and losing my changes when updating the plugin.
- option to do the html-formatting myself using parameters.
- option to show the images in different sizes.
- option to choose whether to use an artist-image or the album-artwork.
- group songs by album - that way you could show only one image per album with all the played songs of it right/left of it. Maybe also with the option to show artist-image and album-artwork at the same time. I hope you understand what I’m trying to say
- Possibility to update the widget via Ajax. Would be nice, if the plugin loads without the xml-data at first and retrieves it, when the page is loaded completely. That way the site would load a bit faster.
I’d love to see those features in some future version of the plugin. But no need to hurry
- maybe in 2.0 or 3.0 
These are good suggestions. Maybe in 2.0 or 3.0 then
Teşekkürler,güncelledikten sonra oldu.
Keep up the good work! 10q
Hi there! I have problem “This username does not exist, or the feed service is down”. in new version. but old version it’s OK!
@BangDon: I’ll look at that.
When I install the plugin, add it to my widget list and then enter my username I get this error in the widget box: “%BEG_OF_TITLE%Last.fm RPS%END_OF_TITLE%” and nothing displays on the homepage.
I have tried deactivating and reinstalling. Doesn’t work.
Oh - and not meaning to sound rude, thanks for the plugin and all the further support you are offering
@Sammy: Please try to change your theme. If it works with other themes, then it’s a problem with it. Not the plugin itself.
Hi Taha. Nope it doesn’t work in other themes either. Basically what I’ve done is - downloaded the program, uploaded it, activated, put it in my widgets, edited the source and then in the widget box it’s come up with the above error.
In the actual web page all I get is the title of the section and then the PHP is broken from there. No footer is loaded etc.
I’ll persevere because it seems this error is only occuring with me - which is odd.
@Sammy: You are using the same theme with me. so in your third.php try to add it by code if you can.
I really like this plugin! Thank you.
@fog: Thank you for using it.
Many thanks, nice Plugin.
Please permit me to ask a related question: I’m looking for a WordPress plugin that will run once a day and automatically create a blog entry listing the songs I’ve listened to in the last 24 hours. Do you know of such a plugin? Thanks!
@robertneumann: Thanks.
@Bob S: No I don’t know any like that. Sorry.
Hi!
I just installed this plugin a week ago and I really like this plugin, it works really nice and the output is just perfect!
But since yesterday, the plugin only tells me : “This user has not played any songs yet.” I don’t know why. FYI, you can check my last.fm profile.
Maybe there’s a corrupted file on my site ? Can you help me find why I have this message now ? Thanks alot!
@Éric Senterre: Thats working? And that happens when you didn’t listen to any songs since 4 days.
hello, I’m trying the plugin (wordpress 2.6 beta 2) and get this error when activating it :
syntax error, unexpected ‘}’ in F:\web\BENOITGREANT2\blog\wp-content\plugins\lastfm-rps\lastfm.php on line 438
any solution ?
@gordie: which version gives this error?