您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Wyświetla procent koło liczby wypowiedzi
// ==UserScript== // @name Demagog procent // @namespace http://tampermonkey.net/ // @version 2025-06-16 // @description Wyświetla procent koło liczby wypowiedzi // @author MZKNEK // @match https://demagog.org.pl/osoba/* // @icon https://www.google.com/s2/favicons?sz=64&domain=org.pl // @grant none // @license MIT // ==/UserScript== (function () { 'use strict'; function extractAndDisplay() { let trueCount = 0; let falseCount = 0; const items = document.querySelectorAll("li[data-number]"); if (items.length === 0) return; items.forEach(item => { const span = item.querySelector("span"); if (!span) return; const match = span.textContent.match(/(Prawda|Częściowa prawda|Fałsz|Manipulacja)\s*-\s*(\d+)/i); if (match) { const type = match[1].toLowerCase(); const value = parseInt(match[2], 10); if (type === "prawda" || type === "częściowa prawda") { trueCount += value; } else if (type === "fałsz" || type === "manipulacja") { falseCount += value; } } }); const total = trueCount + falseCount; const percent = total > 0 ? (trueCount / total * 100).toFixed(1) : "0.0"; let color = "#F9CA51"; if (percent > 75) color = "#089B16"; else if (percent < 35) color = "#B90000"; const counterSpan = document.querySelector('.dg-post-checked-statements__checked-counter'); if (!counterSpan) return; let existingPercentSpan = document.querySelector('.dg-truth-percent'); if (!existingPercentSpan) { existingPercentSpan = document.createElement("span"); existingPercentSpan.className = "dg-truth-percent"; existingPercentSpan.style.marginLeft = "8px"; existingPercentSpan.style.fontWeight = "bold"; counterSpan.insertAdjacentElement("afterend", existingPercentSpan); } existingPercentSpan.textContent = `(${percent}%)`; existingPercentSpan.style.color = color; } setInterval(extractAndDisplay, 1000); })();