Skip to content

Instantly share code, notes, and snippets.

@sidonath
Created January 30, 2009 18:25
Show Gist options
  • Save sidonath/55178 to your computer and use it in GitHub Desktop.
Save sidonath/55178 to your computer and use it in GitHub Desktop.
// ==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'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment