// ==UserScript== // @name Last.fm Musical Compatibility in Percents [Hans] // @namespace by hans the best aka /user/imblyign/ // @description Shows the percentage of your musical compatibility with any user next to the visual bar. // @include http://www.last.fm/user/* // @run-at document-end // @require http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js // @require http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js // @require https://raw.github.com/andris9/jStorage/master/jstorage.js // ==/UserScript== $(document).ready(function() { if( document.URL !== 'http://www.last.fm' + $('#idBadgerUser').attr('href')){ function getElementsByClass(searchClass, domNode, tagName) { if (domNode == null) domNode = document; if (tagName == null) tagName = '*'; var el = new Array(); var tags = domNode.getElementsByTagName(tagName); var tcl = " "+searchClass+" "; for(i=0,j=0; i 0){ var o = getElementsByClass("reading"); o[0].innerHTML = o[0].innerHTML + " - " + c + "%"; console.log('added percentage'); }else{ var o = getElementsByClass("reading"); o[0].innerHTML = o[0].innerHTML + " - no percentage found"; } } }); }else{ console.log('not added percentage'); } });