Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch mpgstats API to new mlnstats API #134

Closed
axel3rd opened this issue Dec 15, 2019 · 10 comments
Closed

Switch mpgstats API to new mlnstats API #134

axel3rd opened this issue Dec 15, 2019 · 10 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@axel3rd
Copy link
Owner

axel3rd commented Dec 15, 2019

See in @LittleLama in #98, mpgstats API will be updated.

Old endpoint:

https://www.mpgstats.fr/json/customteam.json/[LeagueName]

New endpoint:

https://api.mlnstats.com/leagues/[LeagueName]

Content seems change a little, to analyse.

@axel3rd axel3rd added the enhancement New feature or request label Dec 15, 2019
@axel3rd axel3rd added this to the 1.6 milestone Dec 15, 2019
@axel3rd axel3rd self-assigned this Dec 16, 2019
@axel3rd
Copy link
Owner Author

axel3rd commented Dec 18, 2019

@LittleLama : About new API usage (https://api.mlnstats.com/leagues/[LeagueName]), what is the new endpoint for https://www.mpgstats.fr/json/leagues.json (containing timestamp refresh) ?

Many thanks

@LittleLama
Copy link

LittleLama commented Dec 18, 2019 via email

@axel3rd
Copy link
Owner Author

axel3rd commented Dec 18, 2019

New endpoint is api.mlnstats.com/builds

Many thanks !!

I work on API update, but it would be not very simple.
New API format have many changes, and to support old/new format in same time (to keep all historical unit tests OK) will be tricky.

@axel3rd
Copy link
Owner Author

axel3rd commented Dec 18, 2019

@LittleLama : I will implement the new API like that, but I have some remarks (perhaps this is not a final implementation, ....). This is in no way a criticism or request for change, just feedback about usage.

[1] In some Arrays (players list, player's stats by day), the items could be different types. First element is id (type int), the second element is the value/bean/object. It breaks (a little) the JSON key/value pairs principle and could occurs some difficulties in object deserialization (many language does not like when a list/array does not contain items of same type).

[2] The player stats by day is directly under player, and not under (average) stats like previous API.

Sample with these 2 points:

[
      1155,                               <--- ID / int as first array item
      {                                   <--- bean as second array item
        "n": "Neymar",
         ...
        "s": {
          "g": 7,
          ...
          "pa": 9
        },
        "p": [                             <--- Stats by days are not "under" previous stat bloc
          [
            -36,                           <--- Same "int" & "bean" in same array
            {
              "n": 7,
              "e": 3083,
              "g": 1
            }
          ],
          [

@LittleLama
Copy link

LittleLama commented Dec 18, 2019 via email

@axel3rd
Copy link
Owner Author

axel3rd commented Dec 29, 2019

Hi @LittleLama, rencently the API format has changed. Now start with " (and not { as JSON format) and all double-quotes are escaped.

Sample with https://api.mlnstats.com/leagues/Premier-League:

"{\"bD\":\"2019-12-29T04:30:19.271Z\",\"mL\": ...

It will kept like that ? (The parsing change a little in this case)

Many thanks

@LittleLama
Copy link

LittleLama commented Dec 29, 2019 via email

@axel3rd
Copy link
Owner Author

axel3rd commented Dec 29, 2019

Will be done really quickly

@LittleLama Ok, thanks. I will wait until any adapations. But I pomote pure JSon format, more common 😁.

@LittleLama
Copy link

LittleLama commented Dec 29, 2019 via email

@axel3rd
Copy link
Owner Author

axel3rd commented Dec 29, 2019

Yes me too, consider it will be done like that.

@LittleLama Thx 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants