There are 4 previous versions of this script.
// ==UserScript==
// @name for users of "lastfmmusic" on facebook: Get the code for your profile box and put it to your profile through another app.
// @description The last.fm app has not been updated for ages, profile updates are no longer possible. With this script you just have to go to the settings page of the last.fm app and the FBML code will appear. You can then paste it via another app (e.g "attached")
// @author http://userscripts.org/users/67181
// @include http://apps.*facebook.com/lastfmmusic/settings/*
// @version 1.2
// ==/UserScript==
(function(){
var code1 = ''; var code2 = ''; var code3 = '';
var play = document.getElementById('app_content_2381079642');
var sel = document.getElementById('app2381079642_stationURL').getElementsByTagName('option');
//setTimeout("var color1 = document.getElementById('app2381079642_playerColour').getElementsByTagName('option');",1000);
var color = 'blue';
if (sel.length > 1)
{lib = sel[0].value;
libtxt = trim(sel[0].innerHTML);
code1 = '<fb:swf swfsrc=http://cdn.last.fm/widgets/radio/22.swf?lfmMode=radio&autostart=true&radioURL='+lib+'&title='+libtxt+'&theme='+color+' imgsrc=http://www.fileden.com/files/2007/8/10/1336503/l.jpg width=184 height=140/>';
code1 = code1.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");
code1 = "<b>Library</b><br><table border=1><tr><td>"+code1+"</td></tr></table><br>";
neighbor = sel[1].value;
neighbtxt = trim(sel[1].innerHTML);
code2 = '<fb:swf swfsrc=http://cdn.last.fm/widgets/radio/22.swf?lfmMode=radio&autostart=true&radioURL='+neighbor+'&title='+neighbtxt+'&theme='+color+' imgsrc=http://www.fileden.com/files/2007/8/10/1336503/l.jpg width=184 height=140/>';
code2 = code2.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");
code2 = "<b>Neighbourhood</b><br><table border=1><tr><td>"+code2+"</td></tr></table><br>";
}
var code = document.getElementById('app2381079642_facebook_playlist');
if (code !== null) {
code = code.value;
code3 = '<fb:swf swfsrc=http://cdn.last.fm/widgets/radio/22.swf?lfmMode=radio&autostart=true&radioURL='+code+'&title=Last.fm+Radio&theme='+color+' imgsrc=http://www.fileden.com/files/2007/8/10/1336503/l.jpg width=184 height=140/>';
code3 = code3.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");
code3 = "<b>Facebook profile playlist</b><br><table border=1><tr><td>"+code3+"</td></tr></table><br>";
}
play.innerHTML += '<font color=blue><b>The code is for blue players. For other colors please replace theme=... with the colors red, black and grey.<br></b><br><div id=attached>' + code1 + code2 + code3 + '</div><a style=font-size:10px; href=http://apps.facebook.com/attached/>apps.facebook.com/attached</a>';
var att = document.getElementById('attached');
//att.innerHTML = att.innerHTML.replace(/blue/g,'red');
})();
function trim(stringToTrim) {
return stringToTrim.replace(/^\s+/,"").replace(/\s+$/,"").replace(" ","%20").replace("’","'");
}