Last.fm User Levels

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

Tính đến 19-10-2014. Xem phiên bản mới nhất.

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

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

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.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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);
}