Last.fm generate album BB-code

Adds an textarea on each album page on last.fm, with corresponding bb-code... Cat, dog and mouse ecosystem, but above all cheese.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name Last.fm generate album BB-code
// @namespace  https://github.com/Row/lastfm-userscripts
// @version    0.2
// @description Adds an textarea on each album page on last.fm, with corresponding bb-code... Cat, dog and mouse ecosystem, but above all cheese.
// @match      https://www.last.fm/music/*/*
// @copyright  2014+, You
// @grant unsafeWindow
// ==/UserScript==

var $ = unsafeWindow.jQuery;
var jQuery = unsafeWindow.jQuery;

var imgSrc = $('img.album-cover').attr('src');
var album = $('h1[itemprop=name]').text().trim();
var artist = $('.suggestcorrection strong').eq(1).text();
var genres = $('a[rel=tag]').eq(0).text();
var data = ''
		   + '[img]' + imgSrc + '[/img]' + "\n"
           + '[size=12][artist]' + artist + '[/artist][/size]' + "\n"
           + '[b][album artist=' + artist + ']' + album + '[/album][/b] [i]' + genres +  '[/i]' + "\n"
           + 'Additional comment' + "\n";

$('.album-detail').after('<section><textarea style="width: 100%" rows="5">' + data + '</textarea></section>');