Goodreads Plus RED

Add "Search RED" button to Goodreads

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name Goodreads Plus RED
// @namespace 
// @version 0.1
// @description Add "Search RED" button to Goodreads
// @author 
// @include http*://www.goodreads.com/* 
// @include http*://goodreads.com/*
// @grant none
// ==/UserScript==

console.log("[M+] Tweaking Goodreads...");

// Grab book title (and only title)
var bookTitle = document.getElementById("bookTitle").innerHTML.trim().split('<', 1);
console.log("Book title: " + bookTitle);
var REDSearchUrl = "https://redacted.ch/torrents.php?groupname=" + bookTitle + "&order_by=time&order_way=desc&group_results=1&filter_cat%5B3%5D=1&filter_cat%5B4%5D=1&filter_cat%5B7%5D=1&action=advanced&searchsubmit=1";

// Add 'Search RED' button
var buttonBar = document.getElementById("buyButtonContainer");
if (buttonBar === null || buttonBar == "null") {
buttonBar = document.getElementById("asyncBuyButtonContainer");
}
var buttonUl = buttonBar.getElementsByTagName("ul");
var REDButton = document.createElement("li");
REDButton.innerHTML = '<a id="REDLink" href="' + REDSearchUrl + '" target="_blank" class="buttonBar">Search RED</a>';
REDButton.className = "Button";
buttonUl[0].appendChild(REDButton);

console.log("[M+] 'Search RED' button added!");