Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Генератор хуйни
- // @namespace Генератор_хуйни
- // @version 1.1
- // @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 = `абвгдеёжзийклмнопстфцчшщыэюя`;
- const consonants = `бвгджзйклмнпстфцчшщ`;
- const vowels = `аеиоыэюя`;
- function choice(array) { return array[Math.floor(Math.random() * array.length)] }
- function word() {
- let rand = Math.floor(Math.random() * 2);
- let result = '';
- let length = 5 + Math.round(Math.random() * 9);
- for (let i = 0; i < length; i++) {
- result += choice(i % 2 == rand ? vowels : consonants);
- }
- return result;
- }
- 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