diff --git a/cmd/dealsbot/api/epic.go b/cmd/dealsbot/api/epic.go index bf285e4..b611d21 100644 --- a/cmd/dealsbot/api/epic.go +++ b/cmd/dealsbot/api/epic.go @@ -6,6 +6,7 @@ import ( "io" "log/slog" "net/http" + "strings" "time" ) @@ -131,7 +132,7 @@ func (e EpicStruct) Load() error { } id := fmt.Sprintf("%v%v", e.idPrefix, element.Id) - title := element.Title + title := strings.TrimSpace(element.Title) url := fmt.Sprintf("%v%v", e.baseUrl, productSlug) e.deals[id] = Deal{ diff --git a/cmd/dealsbot/api/gog.go b/cmd/dealsbot/api/gog.go index 518ead9..aeae9e6 100644 --- a/cmd/dealsbot/api/gog.go +++ b/cmd/dealsbot/api/gog.go @@ -6,6 +6,7 @@ import ( "log/slog" "net/http" "regexp" + "strings" ) type GogStruct struct { @@ -125,7 +126,7 @@ func (e GogStruct) Load() error { continue } id := fmt.Sprintf("%v%v", e.idPrefix, appID) - title := bodyGame.Token().Data + title := strings.TrimSpace(bodyGame.Token().Data) url := fmt.Sprintf("%v%v", e.baseUrl, appID) e.deals[id] = Deal{ diff --git a/cmd/dealsbot/api/gogfront.go b/cmd/dealsbot/api/gogfront.go index 52dd6ae..95324ae 100644 --- a/cmd/dealsbot/api/gogfront.go +++ b/cmd/dealsbot/api/gogfront.go @@ -6,6 +6,7 @@ import ( "log/slog" "net/http" "regexp" + "strings" ) type GogFrontStruct struct { @@ -125,7 +126,7 @@ func (e GogFrontStruct) Load() error { continue } id := fmt.Sprintf("%v%v", e.idPrefix, appID) - title := bodyGame.Token().Data + title := strings.TrimSpace(bodyGame.Token().Data) url := fmt.Sprintf("%v%v", e.baseUrl, appID) e.deals[id] = Deal{ diff --git a/cmd/dealsbot/api/humblebundle.go b/cmd/dealsbot/api/humblebundle.go index 4aff02b..c721357 100644 --- a/cmd/dealsbot/api/humblebundle.go +++ b/cmd/dealsbot/api/humblebundle.go @@ -7,6 +7,7 @@ import ( "log/slog" "net/http" "regexp" + "strings" ) type HumbleBundleStruct struct { @@ -117,7 +118,7 @@ func (e HumbleBundleStruct) Load() error { continue } id := fmt.Sprintf("%v%v", e.idPrefix, appID[1]) - title := product.TileName + title := strings.TrimSpace(product.TileName) url := fmt.Sprintf("%v%v", e.baseUrl, appID[1]) e.deals[id] = Deal{ diff --git a/cmd/dealsbot/api/steam.go b/cmd/dealsbot/api/steam.go index 8f6a025..b6843c4 100644 --- a/cmd/dealsbot/api/steam.go +++ b/cmd/dealsbot/api/steam.go @@ -8,6 +8,7 @@ import ( "log/slog" "net/http" "regexp" + "strings" ) type SteamStruct struct { @@ -139,7 +140,7 @@ func (e SteamStruct) Load() error { continue } id := fmt.Sprintf("%v%v", e.idPrefix, appID) - title := game.Data.Name + title := strings.TrimSpace(game.Data.Name) url := fmt.Sprintf("%v%v", e.baseUrl, appID) e.deals[id] = Deal{ diff --git a/cmd/dealsbot/api/ubisoft.go b/cmd/dealsbot/api/ubisoft.go index d7f3138..5bfb100 100644 --- a/cmd/dealsbot/api/ubisoft.go +++ b/cmd/dealsbot/api/ubisoft.go @@ -8,6 +8,7 @@ import ( "log/slog" "net/http" "regexp" + "strings" ) type UbisoftStruct struct { @@ -111,7 +112,7 @@ func (e UbisoftStruct) Load() error { continue } - title := news.Title + title := strings.TrimSpace(news.Title) if len(news.Links) != 1 { return errors.New(fmt.Sprintf("lenght of links for %v is more or less then 1", news.Title)) }