Last active 1518334493

IRCCloud last.fm now-playing bookmarklet - Change the 'e' variable to your own last.fm username.

Revision 487243e4585f61e54695c42e81ae2a91abf5d21a

gistfile1.js Raw
1(function () {
2 var e = "blha303";
3 window.lfmRecentTrack = function (t) {
4 try {
5 var n = (new Array).concat(t.recenttracks.track)[0];
6 var album;
7 if (n.album["#text"]) {
8 album = " (from " + n.album["#text"] + ")";
9 } else {
10 album = "";
11 }
12 var r = e + " is listening to " + n.artist["#text"] + " - " + n.name + album + " " + n.url;
13 cb().say("/me " + r)
14 } catch (i) {}
15 }
16 var n = document.createElement("script");
17 n.setAttribute("type", "text/javascript");
18 n.setAttribute("src", "https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=" + e + "&api_key=891a3154063e53a608e393b7ec9552f9&limit=1&format=json&callback=window.lfmRecentTrack");
19 document.body.appendChild(n)
20})()
gistfile2.js Raw
1javascript:(function(){var e="blha303";window.lfmRecentTrack=function(t){try{var n=(new Array).concat(t.recenttracks.track)[0];var r;if(n.album["#text"]){r=" (from "+n.album["#text"]+")"}else{r=""}var i=e+" is listening to "+n.artist["#text"]+" - "+n.name+r+" "+n.url;cb().say("/me "+i)}catch(s){}};var t=document.createElement("script");t.setAttribute("type","text/javascript");t.setAttribute("src","https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user="+e+"&api_key=891a3154063e53a608e393b7ec9552f9&limit=1&format=json&callback=window.lfmRecentTrack");document.body.appendChild(t)})()