Last.fm User Levels

Add Last.fm User Level ( http://stas.sh/lastfm/ ) to every last.fm profile you visit.

Ajankohdalta 19.10.2014. Katso uusin versio.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name           Last.fm User Levels
// @namespace      http://userscripts.org/users/121410
// @description    Add Last.fm User Level ( http://stas.sh/lastfm/ ) to every last.fm profile you visit.
// @version        0.1.2
// @include        http://www.last.fm/user/*
// @include        http://www.lastfm.*/user/*
// @include        http://cn.last.fm/user/*
// ==/UserScript==

var insertPoint = document.querySelector('div.rightCol h2.heading');

if(insertPoint) {
    var imgUrl   = 'http://stas.sh/lastfm/pic.php?username=';
    var link     = document.createElement('a');
    var userName = document.querySelector('meta[property="og:title"]').getAttribute('content');
    link.setAttribute('href', 'http://stas.sh/lastfm/');
    link.innerHTML = '<img src="' + imgUrl + userName + '" />'
    insertPoint.parentNode.insertBefore(link, insertPoint);
}