Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Генератор хуйни
- // @namespace Генератор_хуйни
- // @version 1.0
- // @description Создай хуйню!
- // @author Анонимус
- // @include *://2ch.*
- // @icon https://i.imgur.com/XK5x1Zr.png
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- for (const area of document.querySelectorAll('.postarea')) {
- const button = document.createElement('div');
- button.innerHTML = `<a style='user-select: none;'><strong>Насрать хуйни</strong></a>`;
- area.parentNode.insertBefore(button, area.nextSibling.nextSibling.nextSibling);
- button.onclick = () => {
- for (const field of document.querySelectorAll('#shampoo')) field.value += paragraph();
- };
- }
- })();
- const alphabet = `абвгдеёжзийклмнопстфцчшщъыьэюя`;
- function letter() { return alphabet[Math.round(Math.random() * alphabet.length)] }
- function word() { return Array.apply(null, Array(2 + Math.round(Math.random() * 8))).map(letter).join('') }
- function sentence() { return Array.apply(null, Array(5 + Math.round(Math.random() * 7))).map(word).join(' ') }
- function paragraph() { return Array.apply(null, Array(5 + Math.round(Math.random() * 10))).map(sentence).map(s => s.charAt(0).toUpperCase() + s.slice(1)).join('. ') + '. ' }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement