remove sentry and move to slog

This commit is contained in:
Seraphim Strub 2023-11-05 16:03:52 +00:00
parent a20bc22ab1
commit 5d2b8f39d9
18 changed files with 134 additions and 232 deletions

View file

@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"golang.org/x/net/html"
"log/slog"
"net/http"
"regexp"
)
@ -14,15 +15,17 @@ type HumbleBundleStruct struct {
idPrefix string
headers map[string]string
deals DealsMap
logger *slog.Logger
}
func NewHumbleBundleApi() HumbleBundleStruct {
func NewHumbleBundleApi(logger *slog.Logger) HumbleBundleStruct {
humbleBundle := HumbleBundleStruct{
url: "https://www.humblebundle.com/",
baseUrl: "https://www.humblebundle.com/store/",
idPrefix: "humblebundle-",
headers: make(map[string]string),
deals: make(map[string]Deal),
logger: logger,
}
humbleBundle.headers["Accept-Language"] = "en"
humbleBundle.headers["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0"