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

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

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