Hi all. I've done a plugin to lastFM, and I'm sharing it now :)
You can download it on: http://www.waltercruz.com/devel/b2evolution/_lastfm.plugin.zip
To configure, just inform in the administration yout lastFM user and the number of tracks to display (for 1 to 10).
In yout skin, just put:
<? $Plugins->call_by_code('b2evo_lastfm',array());?>
As i like caches, I have put a option to use a cache :)
You can setup a wget (or a python script, or a php script) on crontab e make the download of the xml periodically.
A sample python script to do that (just replace my user with yours)
import urllib
import os.path
page = urllib.urlopen('http://ws.audioscrobbler.com/1.0/user/walterphp/recenttra
cks.xml')
fonte = page.read()
page.close()
f = open(os.path.expanduser("~/xml/lastfm.xml"),'w')
f.write(fonte)
f.close()
This will save a file called lastfm.xml in a folder xml in your home folder. So, you can put it on the settings of the plugin and the plugin will use the cache!
[]'s
- Walter
Hah great!!
on a related note... I can't help but request, can you make a plugin for "iLike" as well? hehe :p Last.fm and iLike becomes very useful together (via iTunes that is).
Will try out the plugin asap :D