Recent Topics

1 May 06, 2007 16:00    

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

2 May 06, 2007 17:54

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

3 May 07, 2007 18:59

Could you give a more detailed explanation of what your plugin actually does and show a demo :)

Also a long time ago, I made my own last.fm plugin, http://forums.b2evolution.net/viewtopic.php?t=8368

Maybe a merge could be made? I would like to see a feature added that adds a chart image of the user's choice into the skin or post.


Form is loading...