Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Ганвест Текст Микс - Шнейне Пэпэ Фаа
- // @namespace http://tampermonkey.net/
- // @version 1.0
- // @description Миксует весь текст на странице с мемными словечками Ганвеста (фаа, втфаа, шнейне, пэпэ, кхе кхе)
- // @author You
- // @match *://*/*
- // @grant none
- // @run-at document-end
- // ==/UserScript==
- (function() {
- 'use strict';
- // Массив мемных слов Ганвеста
- const ganvestWords = [
- 'фаа',
- 'фа',
- 'втфаа',
- 'вотофо',
- 'шнейне',
- 'пэпэ',
- 'кхе кхе',
- 'кхе',
- 'фаа втфаа',
- 'кто так может пэпэ',
- 'фа хэ шнейне',
- 'шнайня'
- ];
- // Настройки
- const settings = {
- probability: 0.75, // Вероятность вставки слова (0.15 = 15% слов будут заменены/дополнены)
- insertMode: 'between', // 'between' - между словами, 'replace' - заменять слова, 'both' - и то и то
- excludeDomains: ['youtube.com'], // Домены, где скрипт не работает
- excludeTags: ['SCRIPT', 'STYLE', 'NOSCRIPT', 'IFRAME', 'SVG', 'CODE', 'PRE'] // Теги, которые не трогаем
- };
- // Проверка, нужно ли запускать скрипт на этом домене
- if (settings.excludeDomains.some(domain => window.location.hostname.includes(domain))) {
- return;
- }
- // Получаем случайное слово Ганвеста
- function getRandomGanvestWord() {
- return ganvestWords[Math.floor(Math.random() * ganvestWords.length)];
- }
- // Обрабатываем текст
- function processText(text) {
- const words = text.split(/(\s+)/);
- let result = [];
- for (let i = 0; i < words.length; i++) {
- const word = words[i];
- if (word.trim() === '') {
- result.push(word);
- continue;
- }
- const action = Math.random();
- if (action < settings.probability) {
- if (settings.insertMode === 'replace') {
- result.push(getRandomGanvestWord());
- } else if (settings.insertMode === 'between') {
- result.push(word);
- if (i < words.length - 1) {
- result.push(' ' + getRandomGanvestWord() + ' ');
- }
- } else if (settings.insertMode === 'both') {
- if (Math.random() < 0.5) {
- result.push(getRandomGanvestWord());
- } else {
- result.push(word);
- if (i < words.length - 1) {
- result.push(' ' + getRandomGanvestWord() + ' ');
- }
- }
- }
- } else {
- result.push(word);
- }
- }
- return result.join('');
- }
- function processTextNodes(element) {
- const walker = document.createTreeWalker(
- element,
- NodeFilter.SHOW_TEXT,
- {
- acceptNode: function(node) {
- if (settings.excludeTags.includes(node.parentElement.tagName)) {
- return NodeFilter.FILTER_REJECT;
- }
- if (node.textContent.trim() === '') {
- return NodeFilter.FILTER_REJECT;
- }
- return NodeFilter.FILTER_ACCEPT;
- }
- }
- );
- const nodesToProcess = [];
- let currentNode;
- while (currentNode = walker.nextNode()) {
- nodesToProcess.push(currentNode);
- }
- nodesToProcess.forEach(node => {
- try {
- const originalText = node.textContent;
- const processedText = processText(originalText);
- if (processedText !== originalText) {
- node.textContent = processedText;
- }
- } catch (e) {
- console.error('Ошибка обработки узла:', e);
- }
- });
- }
- console.log('🎤 Ганвест режим активирован! Фаа втфаа шнейне пэпэ кхе кхе');
- processTextNodes(document.body);
- const observer = new MutationObserver((mutations) => {
- mutations.forEach((mutation) => {
- mutation.addedNodes.forEach((node) => {
- if (node.nodeType === Node.ELEMENT_NODE) {
- processTextNodes(node);
- } else if (node.nodeType === Node.TEXT_NODE &&
- node.textContent.trim() !== '' &&
- !settings.excludeTags.includes(node.parentElement.tagName)) {
- try {
- const processedText = processText(node.textContent);
- if (processedText !== node.textContent) {
- node.textContent = processedText;
- }
- } catch (e) {
- console.error('Ошибка обработки нового узла:', e);
- }
- }
- });
- });
- });
- observer.observe(document.body, {
- childList: true,
- subtree: true
- });
- const style = document.createElement('style');
- style.textContent = `
- .ganvest-indicator {
- position: fixed;
- bottom: 20px;
- right: 20px;
- background: linear-gradient(45deg, #000, #333);
- color: #fff;
- padding: 10px 15px;
- border-radius: 8px;
- font-family: monospace;
- font-size: 12px;
- z-index: 999999;
- box-shadow: 0 4px 6px rgba(0,0,0,0.3);
- cursor: pointer;
- transition: all 0.3s ease;
- }
- .ganvest-indicator:hover {
- transform: scale(1.05);
- box-shadow: 0 6px 8px rgba(0,0,0,0.4);
- }
- `;
- document.head.appendChild(style);
- const indicator = document.createElement('div');
- indicator.className = 'ganvest-indicator';
- indicator.innerHTML = '🎤 Ганвест Mode: ON<br>Кхе кхе фаа';
- indicator.title = 'Нажми, чтобы отключить';
- let enabled = true;
- indicator.onclick = () => {
- enabled = !enabled;
- if (enabled) {
- indicator.innerHTML = '🎤 Ганвест Mode: ON<br>Кхе кхе фаа';
- observer.observe(document.body, { childList: true, subtree: true });
- location.reload();
- } else {
- indicator.innerHTML = '🎤 Ганвест Mode: OFF';
- observer.disconnect();
- location.reload();
- }
- };
- document.body.appendChild(indicator);
- })();
Advertisement