forked from dmgk/faker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhacker.go
103 lines (91 loc) · 3.74 KB
/
hacker.go
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
package faker
import (
"fmt"
"unicode"
)
type FakeHacker interface {
SaySomethingSmart() string // => "If we connect the bus, we can get to the XML microchip through the digital TCP sensor!"
Abbreviation() string // => "HTTP"
Adjective() string // => "cross-platform"
Noun() string // => "interface"
Verb() string // => "bypass"
IngVerb() string // => "parsing"
Phrases() []string /* =>
"If we bypass the program, we can get to the AGP protocol through the optical SDD alarm!",
"We need to calculate the back-end XML microchip!",
"Try to generate the GB bus, maybe it will hack the neural panel!",
"You can't navigate the transmitter without synthesizing the optical SMS bus!",
"Use the optical THX application, then you can override the mobile port!",
"The CSS monitor is down, quantify the multi-byte bus so we can calculate the XSS bandwidth!",
"Connecting the card won't do anything, we need to back up the multi-byte RSS card!",
"I'll reboot the primary SMTP feed, that should monitor the XML protocol!`"
*/
}
type fakeHacker struct{}
func Hacker() FakeHacker {
return fakeHacker{}
}
func (h fakeHacker) SaySomethingSmart() string {
return RandomChoice(h.Phrases())
}
func (h fakeHacker) Abbreviation() string {
return Fetch("hacker.abbreviation")
}
func (h fakeHacker) Adjective() string {
return Fetch("hacker.adjective")
}
func (h fakeHacker) Noun() string {
return Fetch("hacker.noun")
}
func (h fakeHacker) Verb() string {
return Fetch("hacker.verb")
}
func (h fakeHacker) IngVerb() string {
return Fetch("hacker.ingverb")
}
func capitalize(s string) string {
return string(unicode.ToTitle(rune(s[0]))) + s[1:]
}
// Example:
// package main
//
// import (
// "fmt"
// "syreclabs.com/go/faker"
// )
//
// func main() {
// for _, s := range (faker.Hacker{}.Phrases()) {
// fmt.Println(s)
// }
// }
//
// Output:
// If we bypass the program, we can get to the AGP protocol through the optical SDD alarm!
// We need to calculate the back-end XML microchip!
// Try to generate the GB bus, maybe it will hack the neural panel!
// You can't navigate the transmitter without synthesizing the optical SMS bus!
// Use the optical THX application, then you can override the mobile port!
// The CSS monitor is down, quantify the multi-byte bus so we can calculate the XSS bandwidth!
// Connecting the card won't do anything, we need to back up the multi-byte RSS card!
// I'll reboot the primary SMTP feed, that should monitor the XML protocol!
func (h fakeHacker) Phrases() []string {
return []string{
fmt.Sprintf("If we %s the %s, we can get to the %s %s through the %s %s %s!",
h.Verb(), h.Noun(), h.Abbreviation(), h.Noun(), h.Adjective(), h.Abbreviation(), h.Noun()),
fmt.Sprintf("We need to %s the %s %s %s!",
h.Verb(), h.Adjective(), h.Abbreviation(), h.Noun()),
fmt.Sprintf("Try to %s the %s %s, maybe it will %s the %s %s!",
h.Verb(), h.Abbreviation(), h.Noun(), h.Verb(), h.Adjective(), h.Noun()),
fmt.Sprintf("You can't %s the %s without %s the %s %s %s!",
h.Verb(), h.Noun(), h.IngVerb(), h.Adjective(), h.Abbreviation(), h.Noun()),
fmt.Sprintf("Use the %s %s %s, then you can %s the %s %s!",
h.Adjective(), h.Abbreviation(), h.Noun(), h.Verb(), h.Adjective(), h.Noun()),
fmt.Sprintf("The %s %s is down, %s the %s %s so we can %s the %s %s!",
h.Abbreviation(), h.Noun(), h.Verb(), h.Adjective(), h.Noun(), h.Verb(), h.Abbreviation(), h.Noun()),
capitalize(fmt.Sprintf("%s the %s won't do anything, we need to %s the %s %s %s!",
h.IngVerb(), h.Noun(), h.Verb(), h.Adjective(), h.Abbreviation(), h.Noun())),
fmt.Sprintf("I'll %s the %s %s %s, that should %s the %s %s!",
h.Verb(), h.Adjective(), h.Abbreviation(), h.Noun(), h.Noun(), h.Abbreviation(), h.Noun()),
}
}