
Major U.K. Real-Time Train Database Opens Up To More Developers - edward
http://techcrunch.com/2014/05/20/darwin-evolves/
======
Joeboy
Half-baked business idea: Train Dating

Allow people to post a profile, and to say "I am currently on this train and
potentially interested in chatting to somebody". You have an audience of bored
people with smartphones, you have a ready made safe public place, and if your
date is not to your taste you have an automatic cut off time. You haven't
wasted an evening on a date, you've just multitasked travelling and dating in
a low stakes context.

Bootstrapping it to the point where people have a chance of actually finding
somebody else on their train would be challenging, but that's what growth
hackers are for, isn't it?

Maybe the focus should be on "meeting" / "chatting" rather than "dating". I'd
suggest calling the app "Strangers on a Train", although the murder
association might be off-putting for some.

Disclaimer: I am clearly not a businessman.

Edit: If anybody reading this _is_ a businessperson and seriously wants to try
to make this work, feel free to get in touch with me about doing the tech side
of it.

~~~
kintamanimatt
You've described Grindr, but for all sexual orientations and with more
appropriate geolocation! This could actually work!

~~~
lotsofmangos
If it takes off, the potential impact on train toilet cubicles could be pretty
bad. Though the queue might get more interesting.

------
bcraven
I have always used traintimes.org.uk because of the excellent approach the
developer took regarding urls: If I want to know the next trains from Leeds to
York I can simply go to the address "traintimes.org.uk/Leeds/York".

The homepage suggests the data is obtained "by screenscraping the information
on the official [National Rail Enquiries] site", perhaps bypassing the Darwin
Database?

~~~
kzar
Cool, that looks really useful. The number of times I've had to fumble on
thetrainline with patchy reception! Do you know any websites that figure out
the cheapest combination of tickets to get you to your destination? (Sometimes
buying several tickets for legs of your journey is cheaper than buying one
ticket for it.)

~~~
joshvm
[http://www.redspottedhanky.com/](http://www.redspottedhanky.com/) is supposed
to be quite good for that, though I've never used it.

Never use The Train Line. They charge a booking fee. Just your local train
operator, they all use exactly the same system, same database, etc but you
won't pay £1 to buy the ticket.

~~~
kzar
Oh I didn't use them to book, only to check which train I needed to catch.

~~~
joshvm
In that case I just use National Rail, the website is well optimised for
mobile.

------
thom
I went to OpenTech 2013 and by far the most packed session was Peter Hicks'
(Poggs) talk about open rail data[1]. I worked at Rockshore, who maintain the
Network Rail datafeeds, and I remain grateful but astonished at how passionate
people are about this data.

[1]
[http://www.opentech.org.uk/2013/audio/streamC/session4.mp3](http://www.opentech.org.uk/2013/audio/streamC/session4.mp3)

~~~
toyg
The huge London-centric contingent of developers likely have to endure a hour-
long train trip twice a day, every day. That's basically a month of their
life, every year, spent in trains. Obviously they'd jump at the opportunity to
improve their life, if given half the chance.

------
yangyang
On a related note, Realtime Trains is an excellent website (and app) for
showing current (and historical) train running times:
[http://realtimetrains.co.uk/](http://realtimetrains.co.uk/)

It often shows platforms before they're announced in-station, which can be
very handy.

~~~
duncans
I find it shows the platforms weeks in advance.

------
Nanzikambe
Just FYI, none the API doesn't function unless you include the following, hope
it saves someone some time!

    
    
           default_reasons = {
               0: "leaves on the track",
               1: "vandalism",
               2: "drunk chavs",
               3: "driver being absolutely shitfaced",
               4: "solar flares",
               5: "transport police randomly deciding to stop and search everyone on board",
               6: "you having an interview",
               7: "a possible UFO sighting in Belgium",
               8: "British Rail",
               9: "lack of coffee at the previous station, so the driver has just nipped off to get some",
               10: "leaves on the track",
               11: "flooding within 300km of a railway sleeper"
           }
           delay_all_trains_by_minutes = 5
           if date.today().day % 2 == 1:
               delay_all_trains_by_minutes = random.randrange(1,30,1)
           print 'All trains will be delayed by %d minutes(s) due to %s' % \
                 (delay_all_trains_by_minutes, default_reasons[random.randrange(0,len(default_reasons),1)])

~~~
lordmauve
Code review:

default_reasons doesn't need to be a dict. Use a list.

You don't need random.randrange(). Use random.randint() to select a random
integer and random.choice() to select a reason from default_reasons.

~~~
Joeboy
default_reasons seems like an odd choice of name, when there is no other kind
of reasons. I'd suggest something like reason_choices or reason_options.

Edit: also I'd make it a tuple rather than either a dict or a list.

~~~
lordmauve
Don't make it a tuple. A tuple indicates heterogenous data (a record), while a
list indicates a sequence of data.

If nothing else, use lists because the syntax means it stays as a list even if
you someday remove all but one option and forget to leave a comma, eg.

    
    
      REASONS = [
        'leaves on the line'
      ]
    

vs

    
    
      REASONS = (
        'leaves on the line'
      )

~~~
Joeboy
After DDGing a bit it seems like you have a point. I did not know about that
semantic difference between tuples and lists in python. It seems like this
difference is entirely about the meaning conveyed to a human reader, rather
than any technical difference. My guess would be that tuples are generally
more efficient, but I have no actual data to back that up with.

------
coob
I had the first app on the iOS App Store for live UK train times back in 2008.
It is no longer available for legal reasons. I wonder if this means I can
rerelease it :)

~~~
jamesbrownuhh
I remember an early one just called 'Trains' that had a very similar stylistic
look to the built-in Weather app.

Liked it a lot, was sad when it stopped working one day.

~~~
coob
That was the one :)

~~~
jamesbrownuhh
Congrats, it was a great app. I hope you rerelease it. :)

------
mkohlmyr
Don't know if Tom (Real Time Trains) reads hacker news, but if you do -
congrats on the mention! Obsession clearly pays.

~~~
maaarghk
Thank you to this article for introducing me to this amazing app / website.
Scotrail's app is slow and buggy and awful, so even if the data isn't NRE, the
better app alone wins this.

------
beejiu
I had an cool idea for an app: When I need a connecting service from the tube
to a mainline, my phone should alert me whether I need to run for the train or
if I have time for a coffee when I get close to the station. At the moment, I
travel at irregular times and have to bring paper timetables around
everywhere. I might even have a go at building this, if I have enough time.

------
basicallydan
Great stuff! The race to build a map of the UK with trains moving around on it
begins in 11 days.

I hope that we'll see an app for the UK with CityMapper levels of awesomeness
soon, that would be rad. The National Rail apps built by the various train
operators are missing some good stuff.

~~~
majc2
TrainTimes already has a map
([http://traintimes.org.uk/map/#bhm](http://traintimes.org.uk/map/#bhm))
although I'm not sure of their data source.

I've looked at this before and it's already doable through the network rail
api
([https://datafeeds.networkrail.co.uk/](https://datafeeds.networkrail.co.uk/)),
which differs from the national rail enquiries api and as far as I can
remember (and can see) is free.

~~~
lucaspiller
Playing around with it, there is room for improvement in the accuracy. Quite a
few routes and stations are missing.

~~~
majc2
Yeah definitely, Edinburgh has acquired a few extra rail bridges! IIRC the
network rail movement feed tells you when a train has reaching specific
passing points, so there is a very granular level of data available if you
want to show movements on the track.

------
mathieup
Is the gagging clause still in place? (
[https://mocko.org.uk/b/2013/02/22/you-cant-use-the-live-
uk-t...](https://mocko.org.uk/b/2013/02/22/you-cant-use-the-live-uk-train-
data-without-accepting-a-gagging-clause/) )

~~~
mocko
I don't know because I haven't yet seen the terms. I'll be keeping the
champagne on ice until I do.

------
thehodge
Hopefully we will see the return of MyRailLite

------
tomorgan
nothing about our trains is "Real Time".

