Journey planner bot uni project

162 views
Skip to first unread message

Matt Darby

unread,
Jan 6, 2022, 4:20:25 PM1/6/22
to A gathering place for the Open Rail Data community

Hello
My son's at uni and has been tasked with creating a bot that can find the cheapest rail ticket between two stations. I've been trying to help him research how to do this. Essentially it's just the bot conversing with a user, asking what the starting point is, what the destination is, and when would you like to travel. Having captured that the bot would need to call a service to fetch the possible times and tickets (in the same way thetrainline.com would). 

After spending a few hours googling for suitable APIs, the OJP services, and the RTJP service in particular, seem the most likely to be able to provide this date in realtime via a set of services calls. 

I'm hoping for a little guidance to make sure I'm on the right lines (my son's left it late to get this done :-/):

Is that the best service to use for this project or is there something more suitable that I've not found?
Do I need to have an account / credentials and if so how can I get those?
Is this service free?
SOAP/WSDL isn't the easiest of API integrations - is an easier way to call these services?

 Thanks!
Matt

Peter Hicks

unread,
Jan 6, 2022, 5:19:44 PM1/6/22
to A gathering place for the Open Rail Data community
Hi Matt


On 6 Jan 2022, at 21:09, Matt Darby <matthew...@gmail.com> wrote:

I'm hoping for a little guidance to make sure I'm on the right lines (my son's left it late to get this done :-/):

Is that the best service to use for this project or is there something more suitable that I've not found?
Do I need to have an account / credentials and if so how can I get those?
Is this service free?
SOAP/WSDL isn't the easiest of API integrations - is an easier way to call these services?

This task sounds like it has two parts - creating the bot, and then calling another service to do the heavy lifting.  If time is tight, your son might be better off concentrating on the bot, and stubbing out a back-end service to return canned answers.

Have a look at https://wiki.openraildata.com/index.php?title=Real_Time_Journey_Planner for details of how to request access to the RTJP service if you wanted to look at it.  I believe the pricing structure is quite straightforward and relatively simple - think in terms of a beer in the SU once a week, rather than something hideously expensive such as a textbook.


Peter



OpenTrainTimes Ltd. registered in England and Wales, company no. 09504022.
Registered office: Suite 1-3, Hop Exchange, 24 Southwark Street, London SE1 1TY

Douglas Fraser

unread,
Mar 6, 2022, 11:08:33 AM3/6/22
to A gathering place for the Open Rail Data community
Hi,

I only just saw this message now, wished I'd seen it sooner.  For any student at UEA doing the "find the cheapest ticket" project (don't know if Matt's son goes there, though; as far as I know, UEA is the only uni with this sort of coursework), do _NOT_ use the RTJP journey planner. If you end up spending money, you are doing the coursework wrong; it is designed such that screen scraping a site like nationalrail.co.uk is the expected method. Integrating with more complex services like RTJP is more code, more work, etc... and entirely unnecessary given the coursework specification.

The coursework is a bunch of work, but it can be done in the allotted time (so don't leave it until the last minute....!) ; part of it is an exercise in learning how to design and build a system yet not go overboard in terms of system architecture and not get it done.  Sometimes the more work, but easier code is the better idea especially for coursework.  We would hardly expect students to deal with SOAP (if they know how to already, then great, but my recommendation to any student would always be - don't, it is too much trouble and not expected of you)

And if you think you need access to live data feeds like DARWIN, then again, you are overthinking the assignment. Always ask the TAs or professor for advice, we are here for a reason :)

As for Peter's suggestion of "canned answers", again (all due respect to Peter and everything he does for all of us), don't do that either. You are expected to demo your system actually got the right value off of the website you scraped by validating it with a web browser. As a marker, I wouldn't be thrilled with "canned answers".

Doug (frequent TA for the AI module that involves this coursework)
Reply all
Reply to author
Forward
0 new messages