BooruBear

Gathers tags from a few boorus

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         BooruBear
// @namespace    https://greasyfork.org/scripts/456125-boorubear/code/BooruBear.user.js
// @version      0.6
// @description  Gathers tags from a few boorus
// @author       @Archgoddess_gd
// @match        https://danbooru.donmai.us/*
// @match        https://gelbooru.com/*
// @match        https://rule34.xxx/*
// @match        https://censored.booru.org/*
// @grant        none
// @license      MIT
// ==/UserScript==

// Create the button and textarea elements
var button = document.createElement("button");
var textarea = document.createElement("textarea");
var closeButton = document.createElement("button");

button.innerHTML = "Extract Tags";
button.style.position = "fixed";
button.style.bottom = "0";
button.style.right = "0";
button.style.backgroundColor = "black";
button.style.color = "white";

textarea.style.position = "fixed";
textarea.style.bottom = "0";
textarea.style.right = "0";
textarea.style.width = "400px";
textarea.style.height = "200px";
textarea.style.backgroundColor = "black";
textarea.style.color = "white";
textarea.style.display = "none";

closeButton.innerHTML = "Close";
closeButton.style.position = "fixed";
closeButton.style.bottom = "210px";
closeButton.style.right = "0";
closeButton.style.backgroundColor = "black";
closeButton.style.color = "white";
closeButton.style.display = "none";

// Add the button and textarea to the page
document.body.appendChild(button);
document.body.appendChild(textarea);
document.body.appendChild(closeButton);

// Add a click event listener to the button
button.addEventListener("click", function() {
  // Find all instances of "tags=" in the page
  var matches = document.body.innerHTML.match(/tags=([^&"]+)/g);

  if (matches) {
    // For each match, extract the text after the "=" and before the next " or &
    for (var i = 0; i < matches.length; i++) {
      var tag = matches[i].split("=")[1];

      // Replace "%3A" with ":", "%28" with "(", and "%29" with ")"
      tag = tag.replace(/%3A/g, ":").replace(/%28/g, "(").replace(/%29/g, ")").replace(/%27/g, "'").replace(/%21/g, "!").replace(/%3F/g, "?").replace(/%2B/g, "+");

      // Exclude instances of "all" and tags that include "user:", "date:", or "status:"
      if (tag.toLowerCase() !== "all" && !tag.toLowerCase().includes("user:") && !tag.toLowerCase().includes("date:") && !tag.toLowerCase().includes("status:") && !tag.toLowerCase().includes("order:") && !tag.toLowerCase().includes("my_tags") && !tag.toLowerCase().includes("parent:") && !tag.toLowerCase().includes("+")) {
        // Append the tag to the textarea
        textarea.value += tag + " ";
      }
    }
  }

  // Show the textarea and close button
  textarea.style.display = "block";
  closeButton.style.display = "block";
});

// Add a click event listener to the close button
closeButton.addEventListener("click", function() {
  // Hide the textarea and close button
  textarea.style.display = "none";
  closeButton.style.display = "none";
});