-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.js
61 lines (61 loc) · 1.74 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const names = ['Bolsonaro','Bolsomito'],
elements = [...document.getElementsByTagName('*')],
nicknames = [
'Bonoro',
'Bozonaro',
'Bozo',
'Bolso',
'Bolodemilho',
'Jair bolar',
'Bonobo',
'Salnorabo',
'Bonaro',
'Boniro',
'Bono',
'Bonaldo',
'Coiso',
'Boçanaro',
'Bosoro',
'Bololó',
'Bolnossauro',
'Bolsomario',
'Biroliro',
'Trumpnaro',
'Bostonaro',
'Bololo',
'Bolovo',
'Birolito',
'Bolonharo',
'Bonossauro',
'Biroliro',
'Bonorinho',
'Mijonauro',
'Mijair',
'Golden Shower',
'Borsalino',
'Bololiro',
'Bolsonaro vagabundo',
'Bananinha',
'Bobonaro',
'Milicinaro',
'Binorilo',
'Satanaro',
'Bolsoasno',
'Bozoasno',
'Tchutchuca do centrão',
'Broxonaro',
'Maçonaro',
'Embora',
'Inelegível'
],
getRandomPosition = array => Math.floor(Math.random() * array.length),
getRandomNickname = array => array[getRandomPosition(array)],
main = () => elements.forEach((element) => { // code by @pauladiniz - https://github.com/pauladiniz/loremipsum4president <- this girl is awesome <3
let validNodes = [...element.childNodes].filter(n => n.nodeType === 3)
validNodes.forEach((node) => {
let text = node.nodeValue,
politicsSUX = text.replace(new RegExp(names.join('|'), 'ig'), getRandomNickname(nicknames)) // here i put my function to get random nicknames :p
politicsSUX !== text ? node.nodeValue = politicsSUX : ''
})
})
main()