diff --git a/ends.txt b/ends.txt new file mode 100755 index 0000000..ea5271d --- /dev/null +++ b/ends.txt @@ -0,0 +1,6 @@ +licker +wizard +muncher +guzzler +wanker +fucker \ No newline at end of file diff --git a/main.go b/main.go new file mode 100755 index 0000000..3016ca4 --- /dev/null +++ b/main.go @@ -0,0 +1,72 @@ +package main + +import ( + "bufio" + "fmt" + "github.com/aws/aws-lambda-go/events" + "github.com/aws/aws-lambda-go/lambda" + "math/rand" + "net/http" + "os" + "strings" + "time" +) + +var nouns = []string{} +var verbs = []string{} +var ends = []string{} +var nends = []string{} + +func init() { + rand.Seed(time.Now().UnixNano()) + nouns, _ = readFile("nouns.txt") + verbs, _ = readFile("verbs.txt") + ends, _ = readFile("ends.txt") + nends = append(nouns, ends...) +} + +func readFile(path string) ([]string, error) { + file, err := os.Open(path) + if err != nil { + return nil, err + } + defer file.Close() + + var lines []string + scanner := bufio.NewScanner(file) + for scanner.Scan() { + lines = append(lines, scanner.Text()) + } + return lines, scanner.Err() +} + +func getWord(wordlist []string) string { + return wordlist[rand.Intn(len(wordlist))] +} + +func genSwear() string { + swear := "default" + r := rand.Intn(4) + switch r { + case 1: + swear = getWord(nouns) + "-" + getWord(verbs) + " " + getWord(nends) + case 2: + swear = getWord(nouns) + "-" + getWord(ends) + case 3: + swear = getWord(nouns) + "-" + getWord(verbs) + " " + getWord(nouns) + " " + getWord(ends) + default: + swear = getWord(nouns) + "-" + getWord(nends) + } + return strings.Title(swear) +} + +func HandleRequest() (events.APIGatewayProxyResponse, error) { + return events.APIGatewayProxyResponse{ + StatusCode: http.StatusOK, + Body: fmt.Sprintf(genSwear()), + }, nil +} + +func main() { + lambda.Start(HandleRequest) +} diff --git a/nouns.txt b/nouns.txt new file mode 100755 index 0000000..6f34d4c --- /dev/null +++ b/nouns.txt @@ -0,0 +1,59 @@ +anus +ass +badger +bag +ball +bitch +breath +bubble +bucket +burger +butter +canoe +cheese +clown +cluster +cock +cum +dick +douche +dumpster +face +fanny +flap +fuck +goblin +head +hole +house +jizz +jockey +knob +magnet +muffin +nose +nugget +nut +pancake +piss +pouch +puddle +rectum +sack +sandwich +scrote +scrotum +shit +stain +stick +tampon +thunder +tit +trumpet +twat +waffle +wank +weasel +weed +wipe +soggy \ No newline at end of file diff --git a/verbs.txt b/verbs.txt new file mode 100755 index 0000000..cf304eb --- /dev/null +++ b/verbs.txt @@ -0,0 +1,7 @@ +eating +guzzling +licking +smelling +poking +cooking +touching \ No newline at end of file