You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
827B

  1. package main
  2. import (
  3. "fmt"
  4. "io/ioutil"
  5. "log"
  6. "os"
  7. "strings"
  8. )
  9. func loadCookieFile() string {
  10. dat, err := ioutil.ReadFile(cookieFileName)
  11. if err != nil {
  12. log.Fatalln(err)
  13. }
  14. return strings.TrimSuffix(string(dat), "\n")
  15. }
  16. func createCookieFile() {
  17. defaultHelpMessage := `go to random giveway, press f12 on firefox, something something inspector on chrome probably and
  18. enter/leave giveway, click on the thing that pops up (POST, 200, REQUEST or something) and look for PHPSESSID=characters,
  19. copy those into this file, without any formatting just characters`
  20. if _, err := os.Stat(cookieFileName); os.IsNotExist(err) {
  21. err := ioutil.WriteFile(cookieFileName, []byte(defaultHelpMessage), 0644)
  22. if err != nil {
  23. log.Fatalln(err)
  24. }
  25. fmt.Println("Edit " + cookieFileName + " file")
  26. os.Exit(0)
  27. }
  28. }