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

Adding support for late ferry data? #27

Open
daytonturner opened this issue Mar 21, 2022 · 6 comments
Open

Adding support for late ferry data? #27

daytonturner opened this issue Mar 21, 2022 · 6 comments

Comments

@daytonturner
Copy link
Contributor

Hi, just came across your API when attempting to build a BCFerries module for HomeAssistant, thanks for keeping this up to date!

The only other module I found was a bcferries python module that is 7 years old and definitely no longer works, sadly.

The one thing they exposed in theirs that I think yours could benefit from, is exposing whether or not the ferry in question is late or not. For instance, the page you could get this from for Langdale<>Horseshoe Bay would be: https://www.bcferries.com/current-conditions/departures?terminalCode=LNG

I was going to take a crack at adding a parser for this data, but wondering if you or anyone else has already attempted this, or if you are aware of a reason it wouldn't work?

@samuel-pratt
Copy link
Owner

I haven't attempted it yet, honestly I didn't know this info was available on their site. I don't think it would be too hard to add a 'late' field to each sailing on the api, checking that page for the next ferry, and if the text is anything but "On time" set it to true.

I'm currently working on a larger update to revamp the api to be used with a ferry app I'm building, I'll look at adding this to the update.

@daytonturner
Copy link
Contributor Author

That would be awesome! Given that they return "late" or "cancelled" results of each sailing time, I would suspect you could even match these up for all of the results - in some cases, when there are heavy delays, it cam be helpful to know if the next 2 sailings are late, but the 3rd isn't. They post this ahead of time sometimes, if they know mechanical issues or weather are going to resolve themselves around a certain timeframe.

I dont know if you have a github sponsor page set up (kind of like a tip jar idea that github announced a few years ago) but if you do, I'd be happy to send you a donation for your time!

@samuel-pratt
Copy link
Owner

I agree, having that info for all possible sailings would be very helpful, I'll make sure to add that when I do the update.

I didn't have a sponsor page set up but I just made one, nobody's ever asked about that before. Feel no obligation to do so but anything would be greatly appreciated, and would all go to hosting this project. Thanks!

@samuel-pratt
Copy link
Owner

I've just updated the API with the larger changes, and have included a spot on sailing data for vessel status to be included. I'll look into adding it next week, but this update will also require some changes to any current usage of the api.

@daytonturner
Copy link
Contributor Author

daytonturner commented Mar 23, 2022 via email

@daytonturner
Copy link
Contributor Author

So I happened to notice that delays are now showing up, relatively cleanly, in the API 'time' field.

I wonder if its possible to split the additional 'late' information out into its own field.

e.g.:

{"sailingDuration":"","sailings":[{"time":"11:45 AM Delayed approx. 1h",

Instead of having "Delayed approx. 1h" in time, I wonder if we could put it into the "vesselStatus" field, or another?

It will make parsing the fields much easier!

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