Adds a quick vote button to easily open all vote links for a Minecraft server page.
// ==UserScript==
// @name MinecraftServer.buzz Easy Vote Helper
// @namespace https://minecraftserver.buzz/
// @version 1.0
// @description Adds a quick vote button to easily open all vote links for a Minecraft server page.
// @author minecraftserver.buzz
// @license MIT
// @match https://minecraftserver.buzz/server/*
// @icon https://minecraftserver.buzz/favicon.ico
// @grant none
// ==/UserScript==
(function () {
"use strict";
const BUTTON_TEXT = "⭐ Vote for this Server";
const BUTTON_COLOR = "#facc15";
const BUTTON_TEXT_COLOR = "#000";
const Z_INDEX = 9999;
const btn = document.createElement("button");
btn.innerText = BUTTON_TEXT;
Object.assign(btn.style, {
position: "fixed",
bottom: "20px",
right: "20px",
padding: "14px 18px",
fontSize: "16px",
fontWeight: "bold",
background: BUTTON_COLOR,
color: BUTTON_TEXT_COLOR,
border: "none",
borderRadius: "10px",
cursor: "pointer",
boxShadow: "0 6px 16px rgba(0,0,0,0.3)",
zIndex: Z_INDEX,
});
document.body.appendChild(btn);
function getVoteLinks() {
const anchors = document.querySelectorAll("a[href*='vote']");
const links = new Set();
anchors.forEach(a => {
const url = a.href;
if (
url.includes("minecraft") ||
url.includes("vote") ||
url.includes("server")
) {
links.add(url);
}
});
return Array.from(links);
}
btn.addEventListener("click", () => {
const links = getVoteLinks();
if (links.length === 0) {
alert("No vote links found on this page.");
return;
}
if (!confirm(`Open ${links.length} vote page(s)?`)) return;
links.forEach((url, i) => {
setTimeout(() => {
window.open(url, "_blank");
}, i * 600);
});
});
})();