Skip to content

Commit

Permalink
✨ 📚 update v1 / update README
Browse files Browse the repository at this point in the history
  • Loading branch information
FuzzyStatic committed Jan 29, 2021
1 parent e9ce9fb commit 4e224b8
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
# You don't need to test on very old version of the Go compiler. It's the user's
# responsibility to keep their compilers up to date.
go:
- 1.13.x
- 1.16.x

# Only clone the most recent commit.
git:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# blizzard

[![GoDoc](https://godoc.org/github.com/FuzzyStatic/blizzard?status.svg)](http://godoc.org/github.com/FuzzyStatic/blizzard) [![Go Report Card](https://goreportcard.com/badge/github.com/FuzzyStatic/blizzard)](https://goreportcard.com/report/github.com/FuzzyStatic/blizzard) [![Build Status](https://travis-ci.org/FuzzyStatic/blizzard.svg?branch=master)](https://travis-ci.org/FuzzyStatic/blizzard) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/fa25319c93814ff4878ee049f04317d4)](https://www.codacy.com/app/FuzzyStatic/blizzard?utm_source=github.com&utm_medium=referral&utm_content=FuzzyStatic/blizzard&utm_campaign=Badge_Grade)
[![Go Reference](https://pkg.go.dev/badge/github.com/FuzzyStatic/blizzard/v2.svg)](https://pkg.go.dev/github.com/FuzzyStatic/blizzard/v2) [![Go Report Card](https://goreportcard.com/badge/github.com/FuzzyStatic/blizzard)](https://goreportcard.com/report/github.com/FuzzyStatic/blizzard) [![Build Status](https://travis-ci.org/FuzzyStatic/blizzard.svg?branch=master)](https://travis-ci.org/FuzzyStatic/blizzard) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/fa25319c93814ff4878ee049f04317d4)](https://www.codacy.com/app/FuzzyStatic/blizzard?utm_source=github.com&utm_medium=referral&utm_content=FuzzyStatic/blizzard&utm_campaign=Badge_Grade)

> This is a Go client library for gathering [Blizzard API reference](https://develop.battle.net/documentation/api-reference) data
> This is a Go client library for gathering [Blizzard API reference](https://develop.battle.net/documentation/api-reference) data
## Table of Contents

Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
Expand Down
22 changes: 22 additions & 0 deletions v1/sc2gd.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,25 @@ func (c *Client) SC2LeagueData(seasonID int, queueID sc2gd.QueueID, teamType sc2

return &dat, b, nil
}

// SC2LadderData returns SC2 ladder for given division's ladderID.
// This API is undocumented by Blizzard, so it may be unstable.
func (c *Client) SC2LadderData(ladderID int) (*sc2gd.Ladder, []byte, error) {
var (
dat sc2gd.Ladder
b []byte
err error
)

b, err = c.getURLBody(c.apiURL+fmt.Sprintf("/data/sc2/ladder/%d?locale=%s", ladderID, c.locale), "")
if err != nil {
return &dat, b, err
}

err = json.Unmarshal(b, &dat)
if err != nil {
return &dat, b, err
}

return &dat, b, nil
}
43 changes: 43 additions & 0 deletions v1/wowp/characterAchievements.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,46 @@ type CharacterAchievementsSummary struct {
} `json:"realm"`
} `json:"character"`
}

// Statistics struct used for representing nested Statistics
type Statistics []struct {
ID int `json:"id"`
Name string `json:"name"`
LastUpdatedTimestamp int64 `json:"last_updated_timestamp"`
Quantity float64 `json:"quantity"`
Description string `json:"description,omitempty"`
}

// CharacterAchievementsStatistics structure
type CharacterAchievementsStatistics struct {
Links struct {
Self struct {
Href string `json:"href"`
} `json:"self"`
} `json:"_links"`
Character struct {
Key struct {
Href string `json:"href"`
} `json:"key"`
Name string `json:"name"`
ID int `json:"id"`
Realm struct {
Key struct {
Href string `json:"href"`
} `json:"key"`
Name string `json:"name"`
ID int `json:"id"`
Slug string `json:"slug"`
} `json:"realm"`
} `json:"character"`
Categories []struct {
ID int `json:"id"`
Name string `json:"name"`
SubCategories []struct {
ID int `json:"id"`
Name string `json:"name"`
Statistics Statistics `json:"statistics"`
} `json:"sub_categories,omitempty"`
Statistics Statistics `json:"statistics,omitempty"`
} `json:"categories"`
}
7 changes: 4 additions & 3 deletions v1/wowp/characterMedia.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ type CharacterMediaSummary struct {
Slug string `json:"slug"`
} `json:"realm"`
} `json:"character"`
AvatarURL string `json:"avatar_url"`
BustURL string `json:"bust_url"`
RenderURL string `json:"render_url"`
Assets []struct {
Key string `json:"key"`
Value string `json:"value"`
} `json:"assets"`
}

0 comments on commit 4e224b8

Please sign in to comment.