Greasy Fork

RYM: Wikipedia Search

add a link from the release page to search wikipedia for that release

目前为 2021-02-05 提交的版本。查看 最新版本

// ==UserScript==
// @name         RYM: Wikipedia Search
// @description  add a link from the release page to search wikipedia for that release
// @match      https://rateyourmusic.com/release/*
// @match      http://rateyourmusic.com/release/*
// @version.     1.0
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
// @version 0.0.1.20210205193444
// @namespace https://greasyfork.org/users/734885
// ==/UserScript==

const td = '<td colspan="2" style="font-size:0.9em;font-weight:normal;color:var(--mono-5);">'

artist = $(".album_info a.artist").text();
title = $(".page_section .album_title")[0].childNodes[0].nodeValue.trim();

console.log(artist);
console.log(title);

searchterms = encodeURIComponent(artist) + " " + encodeURIComponent(title);

data = '<th class="info_hdr">Wiki</th>'
data += td + '<a target="_blank" href="https://en.wikipedia.org/?search='+searchterms+'">Search Wikipedia for this release</a>' + '</td>'

$(".album_info tbody tr:last").after("<tr>" + data + "</tr>");