Generate patreon links for reactionsBot

This script generates buttons on kemono.party which a copy a link to the clipboard that is usable for the reactionBot

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Generate patreon links for reactionsBot
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  This script generates buttons on kemono.party which a copy a link to the clipboard that is usable for the reactionBot
// @author       Rerte
// @match        https://kemono.party/patreon/user/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=kemono.party
// @grant        none
// ==/UserScript==




let toggle;
//${art.querySelector("header").innerText.toLowerCase().replaceAll(" ","-")}-
document.querySelectorAll("article").forEach(art=> {
    let string = `https://www.patreon.com/join/${document.querySelector('span[itemprop="name"]').innerHTML}/checkout?rid=0&redirect_uri=https://www.patreon.com/posts/${art.attributes.getNamedItem("data-id").value}`;
    let but = document.createElement("button")
    but.innerText = "Link"
    but.onclick=()=>{toggle=true;navigator.clipboard.writeText(string).then(()=>but.innerText="Copied to Clipboard")}
    art.querySelector("a").append(but)
    art.onclick=hrefCheck;
}   )

function hrefCheck(){
    if(toggle){
        toggle=false;
        return false;
    }
}