initial commit

This commit is contained in:
DutchEllie 2022-02-21 12:29:08 +01:00
commit 4d3a4bc48a
Signed by: DutchEllie
SSH Key Fingerprint: SHA256:dKq6ZSgN5E3Viqrw/+xAdf2VdR6hdRGNyrYqXXwfjTY
4 changed files with 370190 additions and 0 deletions

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module kanker.nl
go 1.16

BIN
main Executable file

Binary file not shown.

84
main.go Normal file
View File

@ -0,0 +1,84 @@
package main
import (
"crypto/tls"
"fmt"
"net/http"
"time"
"math/rand"
"os"
"bufio"
)
func main() {
go request()
fmt.Print("launched\n")
go request()
fmt.Print("launched\n")
go request()
fmt.Print("launched\n")
/*
go request()
fmt.Print("launched\n")
go request()
fmt.Print("launched\n")
go request()
fmt.Print("launched\n")
go request()
fmt.Print("launched\n")
go request()
fmt.Print("launched\n")
go request()
fmt.Print("launched\n")
*/
fmt.Printf("Starting an infinite for loop because I don't wanna mess with goroutines right now\n")
for true {
time.Sleep(10000 * time.Second)
fmt.Printf("10000 seconds elapsed")
}
}
func request() {
fmt.Printf("Started")
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
comments, _ := readInput("woorden.txt")
rand.Seed(time.Now().UnixNano())
min := 0
max := len(comments)
for true {
var comment string
var name string
name = comments[rand.Intn(max - min)]
comment = comments[rand.Intn(max - min)]
url := "https://167.86.92.38/repl-api/POST-COMMENT/?arg0=%22home%22&arg1=%22" + name + "%22&arg2=%22" + comment + "%5Cn%22"
_, err := http.Get(url)
if err != nil {
fmt.Printf("kut, %s\n", err.Error())
}
fmt.Printf("Done\n")
}
}
func readInput(filename string) ([]string, error) {
file, err := os.Open(filename)
if err != nil {
return nil, err
}
defer file.Close()
numbers := make([]string, 0)
scanner := bufio.NewScanner(file)
for scanner.Scan() {
number := scanner.Text()
if err != nil {
return nil, err
}
numbers = append(numbers, number)
}
return numbers, nil
}

370103
woorden.txt Normal file

File diff suppressed because it is too large Load Diff