Alex H. ([info]mock2) wrote,
  • Mood: accomplished

Simple Train Times - Updated

Bookmark this on your phone and refer to it whenever you want to avoid dashing around London Bridge when you discover the next train leaves in 30 seconds and is half a mile away from the departure boards.  It's a deliberately spartan page showing the next 4 trains to/from Brockley (where I live) and their platforms.

http://mocko.org.uk/pda/trains

Those unfortunate enough not to live in Brockley can show times for any other direct service by appending the correct CRS codes to the url.

For example:


Geeks: it's done using a call to National Rail's SOAP web interface. See their instructions here.


Advanced Usage - Added 2009-10-25

Return more trains - suffix the query with a number, e.g. http://mocko.org.uk/pda/trains/lbg/lad/10

Combine results of several potential journeys. This is a bit more complex to explain. A good example is where I live - a point equidistant from Brockley and Ladywell stations. Both have trains to/from London Bridge so I'd like to search both at once and get combined results. This means I can hop on whichever train comes first. To do this specify multiple CRS codes in the from/to fields with a ':' between - for example http://mocko.org.uk/pda/trains/LBG/BCY:LAD


Tags: brockley, traintimes

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

  • 12 comments

[info]kirstenlj

October 17 2009, 14:26:35 UTC 2 years ago

Sweet!

It doesn't like my BMS/STP request, but that's probably because there are no trains on that route on the weekend.

[info]poggs

October 17 2009, 16:36:37 UTC 2 years ago

Bromley South - St Pancras direct?

[info]kirstenlj

October 17 2009, 17:51:27 UTC 2 years ago

Yes, takes anywhere between 38 and 44 minutes and it's incredibly handy (as we now live in Bromley) for visiting my family in Islington.

It's Orpington/Sevenoaks to St. Albans./Kentish Town. Unfortunately, it doesn't run on the weekend at all.

[info]poggs

October 18 2009, 02:12:37 UTC 2 years ago

Oh, of *course*! Dur, I should have known that.

[info]poggs

October 17 2009, 16:36:49 UTC 2 years ago

Bug: invalid CRS codes result in

Warning: Invalid argument supplied for foreach() in /var/www/mocko/html/pda/TrainTimes.inc on line 14

[info]poggs

October 17 2009, 16:37:12 UTC 2 years ago

Further bug, it always shows Brockley in the title

[info]poggs

October 17 2009, 16:38:36 UTC 2 years ago

Another bug - if you put a 'recently removed' CRS code, such as ZMG (Moorgate Thameslink) in, it barfs.

[info]poggs

October 17 2009, 16:39:40 UTC 2 years ago

Another bug - services that split en-route are shown as to "oblivion"

[info]poggs

September 29 2010, 12:54:43 UTC 1 year ago

Further problem - WFJ/EUS shows the fast London Midland services and the slower London Overground services with no difference. One takes ~20 minutes, the other around 45. Maybe include the operator and/or arrival time? Or show trains which are overtaken.

[info]mock2

October 17 2009, 16:58:28 UTC 2 years ago

Mr Poggs, one day you'll make an excellent bug tester.

Fixed the various modes of barfing - I simply hadn't bothered writing error handling code yet. Any weirdness with 'recently removed' CRS codes will be down to the LDBWS - I don't handle codes at all on this end.

Oblivion however, that is a feature :)

Anonymous

October 20 2009, 06:48:47 UTC 2 years ago

Finally, a killer app for the iphone

Awesome stuff, Mr H.

[info]mock2

June 22 2010, 09:43:22 UTC 1 year ago

A wee update to this - I've finally fixed it so that trains after midnight are not shuffled straight to the start of the table. Midnight is now after 23:59, just like it is in the real world.
Create an Account
Forgot your login or password?
Facebook Twitter More login options
English • Español • Deutsch • Русский…