-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHelloRobotGenerator.php
148 lines (124 loc) · 3.45 KB
/
HelloRobotGenerator.php
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
class HelloRobotGenerator {
function GetWords() {
$words = array(
'Wi-Fi',
'fiber connection',
'gigabit speed',
'traffic',
'intercepting traffic',
'hack',
'website',
'network',
'password',
'Tor',
'server farm',
'anonymous',
'routing protocol',
'nodes',
'exit nodes',
'emails',
'system files',
'log file',
'dat file',
'system',
'operating system',
'100 terabytes',
'computer',
'terminal',
'AFK',
'sys admin',
'wipe',
'wipe all the data',
'delete',
'cyber security',
'RUDY attack',
'DDoS attack',
'DNS',
'reboot',
'rootkit',
'code',
'malicious code',
'virus',
'worm',
'timing out',
'boot up',
'offline',
'IRC',
'encryption',
'IP',
'data center',
'decrypt',
'compromised',
'brute-force',
'two-step verification',
'data dump',
'breach',
'disconnect',
'connect',
'protocol',
'backup',
'off the grid',
'malware',
'bonsoir',
'fsociety'
);
shuffle($words);
return $words;
}
function MakeSentence() {
// sentences are between 4 and 15 words
$sentence = '';
$length = rand(4,15);
$includeComma = $length >= 7 && rand(0,2) > 0;
$words = $this->GetWords();
if (count($words) > 0) {
$words[0] = ucfirst($words[0]);
for ($i = 0; $i < $length; $i++) {
if ($i > 0) {
if ($i >= 3 && $i != $length - 1 && $includeComma) {
if (rand(0,1) == 1) {
$sentence = rtrim($sentence) . ', ';
$includeComma = false;
} else {
$sentence .= ' ';
}
} else {
$sentence .= ' ';
}
}
$sentence .= $words[$i];
}
$sentence = rtrim($sentence) . '.';
}
return $sentence;
}
public function MakeParagraph() {
// a paragraph should be between 4 and 7 sentences
$para = '';
$length = rand(4,7);
for ($i = 0; $i < $length; $i++) {
$para .= $this->MakeSentence() . ' ';
}
return rtrim($para);
}
public function SpeakToMe($paragraph_number = 5, $sentence_number = 0) {
$paragraphs = array();
if ($sentence_number > 0) {
$paragraph_number = 1;
}
$words = '';
for ($i = 0; $i < $paragraph_number; $i++) {
if ($sentence_number > 0) {
for ($s = 0; $s < $sentence_number; $s++) {
$words .= $this->MakeSentence();
}
} else {
$words = $this->MakeParagraph();
}
$paragraphs[] = rtrim($words);
}
return $paragraphs;
}
}
?>