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

Add current datetime to game events #46

Open
tyler-roper opened this issue Jan 5, 2024 · 1 comment
Open

Add current datetime to game events #46

tyler-roper opened this issue Jan 5, 2024 · 1 comment

Comments

@tyler-roper
Copy link

(We spoke on Reddit about this and you requested I open an issue)

The previous API endpoints for retrieving live game data included a datetime field for each event. The newest endpoints don't seem to provide this information anymore. Examples below.

This makes it impossible to chronologically sort events across several games, for example.

Thank you!

Example of old event shape:

{
  "result": {
    "eventCode": "ANA89",
    "eventTypeId": "HIT",
    "description": "Tomas Nosek hit Adam Henrique",
    "event": "Hit"
  },
  "players": [
    {
      "playerType": "Hitter",
      "player": {
        "link": "/api/v1/people/8477931",
        "fullName": "Tomas Nosek",
        "id": 8477931
      }
    },
    {
      "playerType": "Hittee",
      "player": {
        "link": "/api/v1/people/8474641",
        "fullName": "Adam Henrique",
        "id": 8474641
      }
    }
  ],
  "about": {
    "eventIdx": 123,
    "dateTime": "2023-01-09T02:42:01Z",   <------------------------------------------------
    "eventId": 89,
    "period": 2,
    "periodType": "REGULAR",
    "ordinalNum": "2nd",
    "periodTime": "04:13",
    "periodTimeRemaining": "15:47",
    "goals": {
      "away": 2,
      "home": 1
    }
  },
  "coordinates": {
    "x": 32,
    "y": -39
  },
  "team": {
    "name": "Boston Bruins",
    "link": "/api/v1/teams/6",
    "id": 6,
    "triCode": "BOS"
  }
}

Example of new event shape:

{
  "eventId": 57,
  "period": 1,
  "periodDescriptor": {
    "number": 1,
    "periodType": "REG"
  },
  "timeInPeriod": "00:25",
  "timeRemaining": "19:35",
  "situationCode": "1551",
  "homeTeamDefendingSide": "left",
  "typeCode": 509,
  "typeDescKey": "penalty",
  "sortOrder": 13,
  "details": {
    "xCoord": -94,
    "yCoord": 23,
    "zoneCode": "O",
    "typeCode": "MIN",
    "descKey": "tripping",
    "duration": 2,
    "committedByPlayerId": 8478493,
    "drawnByPlayerId": 8481564,
    "eventOwnerTeamId": 30
  }
}
@Afischbacher
Copy link
Owner

Hi Tyler,

I have ideas on how I would like to execute this, but I will need time to work through this problem, I will provide you with an update when I have one.

Thanks!

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

No branches or pull requests

2 participants