fuzzystatic / blizzard Goto Github PK
View Code? Open in Web Editor NEWGo client library for Blizzard API data
License: MIT License
Go client library for Blizzard API data
License: MIT License
Hi!
There is an undocumented endpoint /data/sc2/ladder/{ladderID}
, that can be used to get the player list for given division. While not 100% stable, it is widely used by sites like rankedftw and such.
Are you interested in a PR adding this endpoint?
Hi again!
Been working on my pet-project using your libray, everything is working great so far
In the WoW auction house API call, there is a header named "Last-Modified" in the response, that tells us when the data has been updated (it's usually once every hour).
Is there a way for me to access response headers from the api calls? I've quickly looked at the code and I couldn't find anything on my end.
Thanks!
Hello!
I'm unable to pull the latest version (v3.0.2) with go get -u github.com/FuzzyStatic/[email protected]
command:
go: github.com/FuzzyStatic/[email protected]: invalid version: module contains a go.mod file, so module path must match major version ("github.com/FuzzyStatic/blizzard/v3")
go get -u github.com/FuzzyStatic/blizzard/[email protected]
does not work too.
It seems you pushed the v3.x.x tag but didn't update the module path to handle v3 versions (module
in go.mod
and imports).
Hello!
I noticed that the AuctionHouse.Auctions struct is missing some information.
Some examples:
{"id":2064367368,"item":{"id":172329,"context":63,"bonus_lists":[6716,7193,1487]},"buyout":14770000,"quantity":1,"time_left":"VERY_LONG"}
The bonus_list
would be nice to have, it allows us to calculate an item's item level, secondary stats, sockets, etc.
Also notice this one has buyout
instead of unit_price
. Materials have a unit_price
, but everything else has a buyout
. This is because of the new Auction House in patch 8.3, the UI is also different in-game for these 2 kind of auctions. It would be nice to have access to both buyout
and unit_price
via this package.
{"id":2064014647,"item":{"id":82800,"context":0,"modifiers":[{"type":6,"value":58613}],"pet_breed_id":21,"pet_level":1,"pet_quality_id":3,"pet_species_id":1577}
Information on pets would be useful! They all have the same item id (82800, which is a cage). The information about the pet itself is in those other values (pet_*
)
Hopefully these make sense!
Thanks
I'm running into some weird issues with some characters:
json: cannot unmarshal string into Go struct field CharacterProfileSummary.active_title of type struct { Key struct { Href string "json:\"href\"" } "json:\"key\""; Name string "json:\"name\""; ID int "json:\"id\""; DisplayString string "json:\"display_string\"" }`
Example characters where it happens:
us/hyjal/Deydorayn
us/bonechewer/Chaitwa
us/kiljaeden/FearnΓΈevil
us/emerald-dream/Heldin
eu/kazzak/Moonjumper
I have retry logic with back-off and the same error happens 10 times in a row on these characters so I don't think it was a temporary glitch
These 2 mythic keystone endpoints are returning 404 for me for some reason, does this happend on your end as well?
2021/05/24 00:48:19 Output will not be printed for tests.
404 Not Found
--- FAIL: TestMythicKeystoneSeasonDetails (0.16s)
404 Not Found
--- FAIL: TestWoWCharacterMythicKeystoneProfileSeason (0.16s)
FAIL
FAIL github.com/FuzzyStatic/blizzard/v2 145.600s
? github.com/FuzzyStatic/blizzard/v2/d3c [no test files]
? github.com/FuzzyStatic/blizzard/v2/d3gd [no test files]
? github.com/FuzzyStatic/blizzard/v2/hsgd [no test files]
? github.com/FuzzyStatic/blizzard/v2/oauth [no test files]
? github.com/FuzzyStatic/blizzard/v2/sc2c [no test files]
? github.com/FuzzyStatic/blizzard/v2/sc2gd [no test files]
? github.com/FuzzyStatic/blizzard/v2/wowcgd [no test files]
? github.com/FuzzyStatic/blizzard/v2/wowgd [no test files]
? github.com/FuzzyStatic/blizzard/v2/wowp [no test files]
ok github.com/FuzzyStatic/blizzard/v2/wowsearch (cached)
FAIL
Hi again
Been having weird issues today, and I think I found the cause:
in header.go
:
if httpHeader.Get(HeaderKeyLastModified) != "" {
header.LastModified, err = time.Parse(time.RFC1123, httpHeader.Get(HeaderKeyLastModified))
if err != nil {
header.LastModified = time.Time{}
}
}
If httpHeader.Get(HeaderKeyLastModified) returns this string: "Sat, 3 Apr 2021 20:06:56 GMT" time.Parse() gives this error:
parsing time "Sat, 3 Apr 2021 20:06:56 GMT" as "Mon, 02 Jan 2006 15:04:05 MST": cannot parse "3 Apr 2021 20:06:56 GMT" as "02"
If instead of using time.RFC1123
I try with a custom format "Mon, _2 Jan 2006 15:04:05 MST"
then it works! Not sure if this still works if the day is > 9. I think so as it's how they handle it in Go's format.go
Hi, im sorry to not be able to give more information but i found a strange error:
when using:
validation, _, err := euBlizzClient.TokenValidation(context.Background(), token)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
err = e.Encode(validation)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
i get the following output:
invalid character '<' looking for beginning of value
{
"exp": 0,
"user_name": "",
"authorities": null,
"client_id": "",
"scope": null
}
i can validate the received token myself and use it for other functions like Userinfo just fine, only the validation function seems to have a problem.
i am using the following settings:
euBlizzClient, err = blizzard.NewClient(blizzard.Config{
ClientID: clientID,
ClientSecret: clientSecret,
HTTPClient: http.DefaultClient,
Region: blizzard.EU,
Locale: blizzard.DeDE,
while trying to find why this happens, i checked the wow dev documentation, they say:
We strongly recommend that developers use the more secure POST /oauth/check_token method.
Hey @FuzzyStatic, thanks for making this package available :).
I have one question.
Is there any reason why you chosen to not allow for context propagation when performing http requests against blizzard APIs?
This would be in certain contexts like cancellation.
I would be keen on making such changes in a PR but they will be breaking changes since the APIs will go from:
func (c *Client) getURLBody(url, namespace string) ([]byte, error) {}
To:
func (c *Client) getURLBody(ctx context.Context, url, namespace string) ([]byte, error) {}
So the release of a new version via creating a v2.0.0
would be required.
Looking forward to hearing from you :).
Add new API calls for the WoW Shadowlands expansion: https://us.forums.blizzard.com/en/blizzard/t/wow-shadowlands-api-update-covenants-soulbinds-more/13385
There are a number of search API calls that need to be implemented. Information about search calls can be found at https://develop.battle.net/documentation/world-of-warcraft-classic/guides/search.
First I want to thank u for cool library.
Second I am not sure that it doesn't work right and maybe I just made the mistake.
I want to search all 52 heroes from battlegrounds mode, but I get only 40.
Maybe, do u know why it happens?
dat, _, err := blizz.HSBattlegroundsCardsSearch( context.Background(), "", "", "", "", "", []int{}, []int{}, []int{}, 0, 0, []hsgd.Tier{hsgd.TierHero}, "", "", "",)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.