add more image urls
This commit is contained in:
parent
0b97f282e2
commit
3a076998f9
5 changed files with 74 additions and 75 deletions
|
@ -42,6 +42,7 @@ type steamApiBodyGame struct {
|
|||
Type string `json:"type"`
|
||||
Name string `json:"name"`
|
||||
IsFree bool `json:"is_free"`
|
||||
HeaderImage string `json:"header_image"`
|
||||
PriceOverview struct {
|
||||
Currency string `json:"currency"`
|
||||
Initial int `json:"initial"`
|
||||
|
@ -95,7 +96,7 @@ func (e SteamStruct) Load() error {
|
|||
return
|
||||
case tt == html.StartTagToken:
|
||||
t := bodyStore.Token()
|
||||
if t.Data != "a" {
|
||||
if t.Data != "a" { // only <a> tag
|
||||
continue
|
||||
}
|
||||
for _, a := range t.Attr {
|
||||
|
@ -139,6 +140,9 @@ func (e SteamStruct) Load() error {
|
|||
if game.Data.Type != "game" {
|
||||
continue
|
||||
}
|
||||
|
||||
image := game.Data.HeaderImage
|
||||
|
||||
id := fmt.Sprintf("%v%v", e.idPrefix, appID)
|
||||
title := strings.TrimSpace(game.Data.Name)
|
||||
url := fmt.Sprintf("%v%v", e.baseUrl, appID)
|
||||
|
@ -147,6 +151,7 @@ func (e SteamStruct) Load() error {
|
|||
Id: id,
|
||||
Title: title,
|
||||
Url: url,
|
||||
Image: image,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue