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

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==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;
    }
}