cubehouse / themeparks

Unofficial API for accessing ride wait times and schedules for Disneyland, Disney World, Universal Studios, and many more parks
MIT License
544 stars 126 forks source link

[Enhancement] Ride schedules in meta - planned for 5.2 #178

Open jeanmatthieud opened 5 years ago

jeanmatthieud commented 5 years ago

Hi,

I noted that in the 5.1 release, the AsterixPark rides contains new meta data, like rides opening/closing time:

// add ride opening/closing time meta data (if available)
if (ridetime.closing_time) {
 const resultRe = reClosingTime.exec(ridetime.closing_time);
  if (resultRe) {
    const closingMoment = Moment.tz(this.Timezone).hours(parseInt(resultRe[1], 10)).minutes(parseInt(resultRe[2], 10)).seconds(0);
    rideUpdateData.meta.rideOpeningTime = todaysOpeningHour;
    rideUpdateData.meta.rideClosingTime = closingMoment.format();
  }
}

Why isn't it on the ride.schedule object? Maybe all ride schedules should be put in the new meta object, to have some kind of consistency, and forgetting about the mandatory aspect induced by the park description (i.e. delete the SupportsRideSchedules key on the park objects). It will be the responsibility of the library caller to check the availability of the data before using it. By doing so, some rides can have schedules, other not, in the same park results.

cubehouse commented 5 years ago

Yes, that would make sense to me.

Schedules on rides was left over from older work, which I had wanted to remove, but 5.x had to come out a bit more rushed than I would have liked with the recent Disney API changes!

I'm happy having them as meta tags, and we should agree on a decent name for them for consistency, even if not many parks support them.

jeanmatthieud commented 5 years ago

Let's agree on something and I can help you we some PR ;)

cubehouse commented 5 years ago

For 5.2.x we should remove SupportsRideSchedules and keep these in the meta data, as they're fairly rare in parks and the schedule object is too complex really for what it needs.

Maybe we should call these "openingTime" and "closingTime", adding ride may be a bit redundant.

Again, as it's an API change, can save it for 5.2.x. I believe WDW parks have their ride opening times somewhere in the database, so can try and get those out if possible.

tjonesrobotics commented 5 years ago

I don't know enough about how the new Disney API works, and I don't understand all your code yet. But I do have some code from the previous API that could fetch ride specific schedules. Is the API similar enough that this would be helpful?

tjonesrobotics commented 5 years ago

I'm trying to find where in WDW parks the wait times are listed, but I'm struggling to see decrypt the SSL traffic. I tried using the mitmproxy in ubuntu, but the Disneyland and Disney World apps aren't passing any traffic (other than JPEGs). If anyone can help me figure out how to intercept and decrypt the Disney apps' traffic, I can work on their schedules.

jeanmatthieud commented 5 years ago

Again, as it's an API change, can save it for 5.2.x. I believe WDW parks have their ride opening times somewhere in the database, so can try and get those out if possible.

Let me know when you are ready for it. No rush ;)