Skip to content
This repository has been archived by the owner on Nov 9, 2024. It is now read-only.

add segments #8

Merged
merged 1 commit into from
Jun 5, 2021
Merged

add segments #8

merged 1 commit into from
Jun 5, 2021

Conversation

RayBB
Copy link
Contributor

@RayBB RayBB commented Jun 2, 2021

This is part of #7 but doesn't fully address it.

Basically, the json seems to have changed so that stopsDetails is now nested under segments.

Like this:

Spoiler
{
"details": [
  {
    "originationAirportCode": "LGA",
    "destinationAirportCode": "TPA",
    "departureTime": "14:30",
    "arrivalTime": "22:10",
    "nextDay": false,
    "totalDuration": 460,
    "flightNumbers": [
      "431",
      "653"
    ],
    "filterTags": [
      "NOON_TO_SIX",
      "AVAILABLE",
      "STOPS"
    ],
    "departureDateTime": "2021-06-22T14:30:00.000-04:00",
    "arrivalDateTime": "2021-06-22T22:10:00.000-04:00",
    "segments": [
      {
        "originationAirportCode": "LGA",
        "destinationAirportCode": "HOU",
        "flightNumber": "431",
        "duration": "03:55",
        "numberOfStops": 0,
        "departureTime": "14:30",
        "arrivalTime": "17:25",
        "departureDateTime": "2021-06-22T14:30:00.000-04:00",
        "arrivalDateTime": "2021-06-22T17:25:00.000-05:00",
        "operatingCarrierCode": "WN",
        "marketingCarrierCode": "WN",
        "aircraftEquipmentType": "73W",
        "features": [
          "WIFI"
        ],
        "wifiOnBoard": true,
        "stopsDetails": [
          {
            "originationAirportCode": "LGA",
            "destinationAirportCode": "HOU",
            "flightNumber": "431",
            "legDuration": 235,
            "stopDuration": 100,
            "changePlanes": true,
            "departureTime": "14:30",
            "arrivalTime": "17:25",
            "departureDateTime": "2021-06-22T14:30:00.000-04:00",
            "arrivalDateTime": "2021-06-22T17:25:00.000-05:00"
          }
        ]
      },
      {
        "originationAirportCode": "HOU",
        "destinationAirportCode": "TPA",
        "flightNumber": "653",
        "duration": "02:05",
        "numberOfStops": 0,
        "departureTime": "19:05",
        "arrivalTime": "22:10",
        "departureDateTime": "2021-06-22T19:05:00.000-05:00",
        "arrivalDateTime": "2021-06-22T22:10:00.000-04:00",
        "operatingCarrierCode": "WN",
        "marketingCarrierCode": "WN",
        "aircraftEquipmentType": "73H",
        "features": [
          "WIFI"
        ],
        "wifiOnBoard": true,
        "stopsDetails": [
          {
            "originationAirportCode": "HOU",
            "destinationAirportCode": "TPA",
            "flightNumber": "653",
            "legDuration": 125,
            "stopDuration": 0,
            "departureTime": "19:05",
            "arrivalTime": "22:10",
            "departureDateTime": "2021-06-22T19:05:00.000-05:00",
            "arrivalDateTime": "2021-06-22T22:10:00.000-04:00"
          }
        ]
      }
    ]
  }
]
}

This PR fixes that so now you can see results if you're able to get past the header issues!

@redfern314
Copy link
Owner

LGTM. I'm actually not able to get the header thing to work anymore... did you successfully test it out? If so, I'll merge this and take a look at the headers later.

@redfern314
Copy link
Owner

Thanks for putting up the PR, by the way :)

@redfern314
Copy link
Owner

I was able to get it to work - it looks like they're invalidating those headers much more often now, you can only use them once or twice.

@redfern314 redfern314 merged commit d7d5342 into redfern314:master Jun 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants