last.fm Numeric Compatibility

By Damir Zekić Last update Jan 30, 2009 — Installed 809 times.

There are 1 previous version of this script.

// ==UserScript==
// @name last.fm Numeric Compatibility
// @namespace http://z3c.info/
// @description Displays the numeric compatibility with a user
// @include http://www.last.fm/user/*
// @include http://www.lastfm*/user/*
// @exclude http://www.last.fm/user/*/*
// @exclude http://www.lastfm*/user/*/*
// ==/UserScript==
 
$ = unsafeWindow.$;
$$ = unsafeWindow.$$;
 
(function (tom) {
  if (!tom) return;
  tom.observe('DOMSubtreeModified', function() {
    tom.stopObserving('DOMSubtreeModified')
      .childElements()[0]
        .insert(
          "(" +
            $$('#tasteometer span.bar span')[0]
              .readAttribute("style")
              .match(/[0-9]+\.?[0-9]*%/) +
          ")");
  });
})($('tasteometer'));