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.

variables.go 1.1KB

123456789101112131415161718192021222324252627282930313233
  1. package main
  2. import (
  3. "regexp"
  4. "time"
  5. )
  6. var (
  7. mainURL = "https://www.steamgifts.com"
  8. pagingURL = "https://www.steamgifts.com/giveaways/search?page="
  9. wishlistURL = "&type=wishlist"
  10. regionRestrictedURL = "&region_restricted=true"
  11. bannedString = "Account has been temporarily blocked"
  12. userAgent = "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36"
  13. mainRegex = regexp.MustCompile(`href="\/giveaway\/(?P<Code>[a-zA-Z0-9]*?)\/[^\/]*?"`)
  14. xsrfRegex = regexp.MustCompile(`name="xsrf_token" value="(?P<XSRF>[0-9a-zA-Z]*?)"`)
  15. pointsRegex = regexp.MustCompile(`<span class=\"nav__points\">(?P<Points>[0-9]{1,3})</span>`)
  16. pointsResponseRegex = regexp.MustCompile(`\"points\":\"(?P<Points>[0-9]+)\"`)
  17. cookieName = "PHPSESSID"
  18. )
  19. // User wariables
  20. var (
  21. cookieFileName = ".steamgifts_cookie"
  22. timeToSleepFor = time.Hour * 5 // how long to wait for each loop
  23. timeToRunFor = time.Hour * 168 // run for a week
  24. quitPoints = int64(10) // setting to lower than 5 considerably extends loop time
  25. )