Because I forget stuff. Part of

Note: It appears you must have reached this page by a deep level URL. In general this site is currently down and unmaintained. See here

About This Post

Originally posted October 30 2006 at 13:10 under Web and General. 3 Comments. Trackbacks Disabled. Last modified: 24 November 2006 at 18:04

Train (On)Line

Some sort of geekiness
Near a train station!
Just good stuff on random play

A post by Jeremy Keith recently reminded me of Matthew Somerville’s accessible UK train timetable, which in the back of my mind I sort of knew existed but hadn’t really had need of a lot, even though the interface is a lot cleaner than the official version (this lack of use is partly due to the fact that, as Matthew points out, it’s insanely long winded to actually buy tickets like that so I tend to stick to the woeful The Trainline). What really caught my attention though were two things: The maps and the hackable URL.

The vaguely live maps just made me sit watching and making happy little sounds—I think this may be some sort of online heaven to me. I seem to be something of a train buff without realising (hey, it’s in the family) and I’ve always loved maps, so marry the two… I could sit watching the trains moving all day (if only Showcase updated its thumbnails with the changing map…suppose I could just open a load of browser windows and tile those).

While the maps make me go “oooohhhhhh” the most practical thing is the wonderful simplicity of a hackable URL. This just means you can go to somewhere like for trains from newcastle to york at 18:30. Then I got carried away (I was waiting for Torchwood to come on you see…) I thought, wouldn’t it be great if I could type “trains from newcastle to york at 18:30” into the browser address bar and have it work? Well, I’m running Firefox so now I can :-) Some explanation….

I wrote a bookmarklet, made possible by a couple of cool things. Firefox supports keywords and, importantly, keyword searches. It doesn’t matter if that bookmark happens to be a bit of javascript which does something quite different with the parameters than form a traditional search URL (when I wrote this I just hacked it together without looking anything up…I wasn’t even sure you could pass the parameters to javascript until I tried. There are actually a few examples of doing so in the knowledge base). So my javascript parses the passed in search terms and produces a URL based on them. Originally I made it to just take the sort of thing I have above, then I got really carried away (well, it didn’t take long to get that far and Torchwood still hadn’t started). It now handles a few more advanced terms, for example: train from newcastle to “london kings cross” in 3 hours More: Now also handles returns and days other than today, see below

The Bookmarklet


The bookmarklet has been moved to it’s own page because things were getting a bit difficult to manage here (and I couldn’t actually get the edit to the post to save with the new version in place!!). Feel free to comment here still if you want.

Comments (3):


Glad you like it; you might guess that I really like the map too. :) I’ve added a link to this from the front page, though you might like to note that I’ve added future date support now too. :-)

Made by Matthew Somerville on Nov 21, 2006 at 21:45


First of all, thanks – I was already a big fan of Matthew’s Traintimes site and its bookmarkable URLs, but your bookmarklets take it to a completely different level. Especially the iframe overlay. I look up a lot of train times, and being able to input natural language searches in the toolbar is amazingly useful! I’ve now also explored some of your other bookmarklets (including the great horizontal split).

Anyway, I wanted to let you know that the Traintimes bookmarklets work perfectly on Camino (Mozilla-based Mac browser) as well.


Made by Jolin Warren on Apr 19, 2007 at 11:56


You strike me as the kind of person who would take on an absurd technical challenge just because a complete stranger asked you to in a blog comment.

Anyway - you know that the bottom of your rail ticket says something like “route: any permitted”. How do you know which route is permitted? Google “National Routeing Guide”. Have a play on the ATOC site. You’ll understand.

Love this site by the way. Have recommended it to so many people I’ve lost count. Thanks!

Made by 0ct0pus on May 15, 2007 at 23:05

Post a comment

Name and email address are required. Email address is never shown. If you enter a URL your name will be linked to it (this and other links will have the rel attribute set to contain nofollow). Markup allowed: <a href="" title="" rel=""> <em> <strong> <abbr title=""> <acronym title=""> <p> <br />. Anything else is stripped; please be valid. Single linebreaks automatically convert to <br />, double to <p>'s. Additionally anything that looks like a bare URL should get automagically linked. Many acronyms and abbreviations are also automagically handled.

Please note this blog's comment policy

Trackbacks (0):

Trackback URL:


This Crazy Fool

Dr Ian Scott
Croydon (and Gateshead), United Kingdom
Bullding Services Engineer (EngDesign), PhD in Physics (University of York), football fanatic (Newcastle United), open source enthusiast (mainly Mozilla)

More about me [Disclaimer]

You may subscribe to IMS_Blog using the RSS Feed, the Atom Feed or by email.

Creative Commons License

From October 30 Other Years

© Ian Scott. Powered by Movable Type 3.2. This blog uses valid XHTML 1.0 Strict and valid CSS. All times are local UK time. For further details see the IMS_Blog about page.. All my feeds in one.