<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>rail &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/rail/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Tue, 02 Sep 2025 19:39:41 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>rail &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[Combining 3 transport APIs for one info screen]]></title>
		<link>https://shkspr.mobi/blog/2023/07/combining-3-transport-apis-for-one-info-screen/</link>
					<comments>https://shkspr.mobi/blog/2023/07/combining-3-transport-apis-for-one-info-screen/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Thu, 06 Jul 2023 11:34:16 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[eink]]></category>
		<category><![CDATA[nook]]></category>
		<category><![CDATA[rail]]></category>
		<category><![CDATA[tfl]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=46190</guid>

					<description><![CDATA[Last year, I blogged about how I turned an old eReader into an Information Screen.  I&#039;ve since updated the display to show me three different sets of transport information.    At a glance, I can see the next bus, whether there are delays on the Elizabeth Line, and if my regular trains are running.  Here&#039;s how all three APIs work.  Bus  The bus is the easiest one of all. Transport for London (TfL) …]]></description>
										<content:encoded><![CDATA[<p>Last year, I blogged about how I <a href="https://shkspr.mobi/blog/2020/02/turn-an-old-ereader-into-an-information-screen-nook-str/">turned an old eReader into an Information Screen</a>.</p>

<p>I've since updated the display to show me <em>three</em> different sets of transport information.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2023/06/departure.jpg" alt="An eInk screen which is displaying the times until the next bus, what delays there are on the tube, and then a bunch of train departure times." width="1024" height="768" class="aligncenter size-full wp-image-46191">

<p>At a glance, I can see the next bus, whether there are delays on the Elizabeth Line, and if my regular trains are running.</p>

<p>Here's how all three APIs work.</p>

<h2 id="bus"><a href="https://shkspr.mobi/blog/2023/07/combining-3-transport-apis-for-one-info-screen/#bus">Bus</a></h2>

<p>The bus is the easiest one of all. Transport for London (TfL) have a set of free APIs. No registration required!
You will need to know the ID of your local bus stop. Visit <a href="https://tfl.gov.uk/disambiguation?Input=oxford+circus&amp;DataSetsJson=%5B%5B%22stopPoints%22%2C%22%2Fmaps%2Fbus%3FInput%3D%7B%7Binput%7D%7D%26InputGeolocation%3D%7B%7Blat%7D%7D%2C%7B%7Blon%7D%7D%26searchBoxType%3Dbus%22%5D%2C%5B%22routes%22%2C%22%2F%7B%7Bmode%7D%7D%2Froute%2F%7B%7BlineIds%7D%7D%2F%22%5D%5D&amp;Modes=bus&amp;PlaceHolderText=Bus+route+or+stop+name&amp;InputGeolocation=">the TfL bus search page</a> and search for your local stop. Click the stop on the map.</p>

<p>You'll be taken to a URl like <a href="https://tfl.gov.uk/bus/stop/490000173RF/oxford-circus-stn-margaret-street"></a><a href="https://tfl.gov.uk/bus/stop/490000173RF/oxford-circus-stn-margaret-street">https://tfl.gov.uk/bus/stop/490000173RF/oxford-circus-stn-margaret-street</a> - that will show you the Bus Stop ID (technically the <a href="https://beta-naptan.dft.gov.uk/">NaPTAN ID</a>). In this case <code>490000173RF</code>.</p>

<p>You can then call this API: <a href="https://api.tfl.gov.uk/StopPoint/490000173RF/arrivals"></a><a href="https://api.tfl.gov.uk/StopPoint/490000173RF/arrivals">https://api.tfl.gov.uk/StopPoint/490000173RF/arrivals</a> - which will return JSON like this:</p>

<pre><code class="language-json">[{
    "$type": "Tfl.Api.Presentation.Entities.Prediction, Tfl.Api.Presentation.Entities",
    "id": "-119695796",
    "operationType": 1,
    "vehicleId": "LTZ1049",
    "naptanId": "490000173RF",
    "stationName": "Oxford Circus Stn  / Margaret Street",
    "lineId": "12",
    "lineName": "12",
    "platformName": "RF",
    "direction": "outbound",
    "bearing": "152",
    "destinationNaptanId": "",
    "destinationName": "Dulwich Library",
    "timestamp": "2023-06-29T10:40:18.3147535Z",
    "timeToStation": 1470,
    "currentLocation": "",
    "towards": "Trafalgar Square Or Green Park",
    "expectedArrival": "2023-06-29T11:04:48Z",
    "timeToLive": "2023-06-29T11:05:18Z",
    "modeName": "bus",
    "timing": {
        "$type": "Tfl.Api.Presentation.Entities.PredictionTiming, Tfl.Api.Presentation.Entities",
        "countdownServerAdjustment": "-00:00:02.7011995",
        "source": "2023-06-29T07:28:52.918Z",
        "insert": "2023-06-29T10:40:01.313Z",
        "read": "2023-06-29T10:39:58.591Z",
        "sent": "2023-06-29T10:40:18Z",
        "received": "0001-01-01T00:00:00Z"
    }
}, {
    "$type": "Tfl.Api.Presentation.Entities.Prediction, Tfl.Api.Presentation.Entities",
    "id": "-1460579610",
    "operationType": 1,
    "vehicleId": "LTZ1447",
    "naptanId": "490000173RF",
    "stationName": "Oxford Circus Stn  / Margaret Street",
    "lineId": "12",
    "lineName": "12",
</code></pre>

<p>Hopefully the entity names are self-explanatory. If you need a specific route, you will need to filter on the <code>lineId</code>'s value.</p>

<p>Personally, I use <code>timeToStation</code> to see how long until the bus arrives. If it's less than a couple of minutes, I don't display it.</p>

<h2 id="crossrail"><a href="https://shkspr.mobi/blog/2023/07/combining-3-transport-apis-for-one-info-screen/#crossrail">CrossRail</a></h2>

<p>Again, I am overjoyed that TfL have a free API which lets you check the status of various tube lines.</p>

<p>The Elizabeth Line's status can be found at <a href="https://api.tfl.gov.uk/Line/elizabeth/status"></a><a href="https://api.tfl.gov.uk/Line/elizabeth/status">https://api.tfl.gov.uk/Line/elizabeth/status</a> - can you guess the URl for the other lines 😉?</p>

<p>And, again, we get back some fairly self-explanatory JSON:</p>

<pre><code class="language-json">[{
    "$type": "Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities",
    "id": "elizabeth",
    "name": "Elizabeth line",
    "modeName": "elizabeth-line",
    "disruptions": [],
    "created": "2023-06-27T12:37:57.107Z",
    "modified": "2023-06-27T12:37:57.107Z",
    "lineStatuses": [{
        "$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
        "id": 0,
        "lineId": "elizabeth",
        "statusSeverity": 9,
        "statusSeverityDescription": "Minor Delays",
        "reason": "Minor delays between Stratford and Shenfield due to a an earlier signal failure at Tottenham Court Road. GOOD SERVICE on the rest of the line. ",
        "created": "0001-01-01T00:00:00",
        "validityPeriods": [{
            "$type": "Tfl.Api.Presentation.Entities.ValidityPeriod, Tfl.Api.Presentation.Entities",
            "fromDate": "2023-06-29T10:30:50Z",
            "toDate": "2023-06-30T00:29:00Z",
            "isNow": true
        }],
        "disruption": {
            "$type": "Tfl.Api.Presentation.Entities.Disruption, Tfl.Api.Presentation.Entities",
            "category": "RealTime",
            "categoryDescription": "RealTime",
            "description": "Minor delays between Stratford and Shenfield due to a an earlier signal failure at Tottenham Court Road. GOOD SERVICE on the rest of the line. ",
            "affectedRoutes": [],
            "affectedStops": [],
            "closureText": "minorDelays"
        }
    }],
    "routeSections": [],
    "serviceTypes": [{
        "$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
        "name": "Regular",
        "uri": "/Line/Route?ids=Elizabeth line&amp;serviceTypes=Regular"
    }],
    "crowding": {
        "$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities"
    }
}]
</code></pre>

<p>You can grab the text out of there for easy display.</p>

<h2 id="train-times"><a href="https://shkspr.mobi/blog/2023/07/combining-3-transport-apis-for-one-info-screen/#train-times">Train Times</a></h2>

<p>This is the only pain-in-the-arse service.  It uses <a href="https://realtime.nationalrail.co.uk/OpenLDBWS/">National Rail's Live Departure Boards Web Service (LDBWS)</a>. This is an XML SOAP API which requires credentials.</p>

<p><a href="https://realtime.nationalrail.co.uk/OpenLDBWSRegistration/Registration">Register for an API token at National Rail's site</a>.</p>

<p>Find the three letter CRS code for your departure and arrival station <a href="https://www.nationalrail.co.uk/find-a-station/">on the National Rail website</a>.</p>

<p>I use the <a href="https://lite.realtime.nationalrail.co.uk/OpenLDBWS/#GetDepBoardWithDetailsHeader"><code>GetDepBoardWithDetailsHeader()</code></a> API call. For example: <code>GetDepBoardWithDetails(20, "WWA", "LBG", "to")</code> gets the next 20 trains <em>from</em> Woolwich Arsenal <em>to</em> London Bridge.</p>

<p>There are <a href="https://github.com/orgs/openraildata/repositories?type=all">OpenLDBWS libraries available in most major programming languages</a>. Don't bother writing your own!</p>

<p>There's more discussion online about <a href="https://wiki.openraildata.com/index.php/OpenLDBWS_Troubleshooting">how to test and use OpenLDBWS</a>.</p>

<p>Once you've got a response, you can filter it for the specific trains you're interested in.</p>

<h2 id="putting-it-all-together"><a href="https://shkspr.mobi/blog/2023/07/combining-3-transport-apis-for-one-info-screen/#putting-it-all-together">Putting it all together</a></h2>

<p>Well, that's up to you Sparky! Personally, I have a hodge-podge of PHP building it into a format suitable for my ancient eInk screen. You can do what you like!</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=46190&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2023/07/combining-3-transport-apis-for-one-info-screen/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[if ( gender == "female" && married == True && age >=30 ) { hasChildren = True; }]]></title>
		<link>https://shkspr.mobi/blog/2021/05/if-gender-female/</link>
					<comments>https://shkspr.mobi/blog/2021/05/if-gender-female/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Wed, 12 May 2021 11:21:11 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[badvertising]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[marketing]]></category>
		<category><![CDATA[rail]]></category>
		<category><![CDATA[spam]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=38952</guid>

					<description><![CDATA[Marketing really is crap. Recently, SE Railways sent this piece of email drivel to my wife:   We don&#039;t have any kids, thankfully - and are not having any in the future. My wife was literally recovering from a sterilisation procedure when the email arrived. So it seemed a bit weird that they&#039;d send her a message like that.  My wife has never booked a child&#039;s fare. She&#039;s done nothing to indicate to …]]></description>
										<content:encoded><![CDATA[<p>Marketing really is crap. Recently, SE Railways sent this piece of email drivel to my wife:
<img src="https://shkspr.mobi/blog/wp-content/uploads/2021/05/travel-savy.png" alt="Email promting parents to get their kids travel savvy." width="270" height="455" class="aligncenter size-full wp-image-38953"></p>

<p>We don't have any kids, <a href="https://shkspr.mobi/blog/2019/11/do-you-have-kids-thankfully-no/">thankfully</a> - and are not having any in the future. My wife was literally <a href="https://web.archive.org/web/20210426113238/https://mymisanthropicmusings.org.uk/getting-my-tubes-tied/">recovering from a sterilisation procedure</a> when the email arrived. So it seemed a bit weird that they'd send her a message like that.</p>

<p>My wife has never booked a child's fare. She's done nothing to indicate to them that she has spawned. They know that she's married and female, because she set her title to "Mrs". They got her date of birth from the ID checks they carried out - we think.</p>

<p>As far as we can tell, they've unilaterally decided that all married women of a certain age must have kids. Or, perhaps, they just lazily sent the message to all women?</p>

<p>So, she spoke to them, to ask why this specific piece of guff had been sent to her.  All they'd say was the rather nebulous statement that the emails was a "targeted email sent to a number of passengers [...] When passengers use our services we're able to use this data to help us target communications effectively."</p>

<p>Not really answering the question. But they decided to bung us £20 of M&amp;S vouchers for the "upset".</p>

<p>Even the most modest of interactions with a company will be data-mined for trivial details in the vague hope of getting you to spend more money.</p>

<p>Here are a few tips if you want to avoid getting microtargetted like this:</p>

<ul>
<li>Consider using a gender neutral title like Mx - or earn yourself a doctorate.</li>
<li>Use an initial rather than a first name. <a href="https://www.ons.gov.uk/peoplepopulationandcommunity/birthsdeathsandmarriages/livebirths/articles/babynamessince1904howhasyoursperformed/2016-09-02">Names <em>can</em> be used to determine likely age</a>.</li>
<li>Don't answer any demographic questions which aren't necessary to the provision of the service, or have a legal/regulatory basis.</li>
<li>You generally can't unsubscribe from service emails, but you can close your account once you've finished your transaction. Digital hygiene is essential!</li>
</ul>

<p>Of course, if you complain about a mistargeted email, that's another data-point they have about you!</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=38952&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2021/05/if-gender-female/feed/</wfw:commentRss>
			<slash:comments>17</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Great Western Rail's Contempt For Customers]]></title>
		<link>https://shkspr.mobi/blog/2016/11/great-western-rails-contempt-for-customers/</link>
					<comments>https://shkspr.mobi/blog/2016/11/great-western-rails-contempt-for-customers/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Tue, 15 Nov 2016 08:16:13 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[fgw]]></category>
		<category><![CDATA[gwr]]></category>
		<category><![CDATA[NaBloPoMo]]></category>
		<category><![CDATA[rail]]></category>
		<category><![CDATA[travel]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=23654</guid>

					<description><![CDATA[Moribund train company Great Western Rail currently have a two month backlog of complaints.  I think that this breaches their agreement with the Office of Rail and Road.  In an ideal world GWR would be forced to improve, or be stripped of their franchise.  I&#039;ve spent an utterly miserable month commuting between Oxford and London on GWR&#039;s over-crowded and decrepit trains.  I was delayed around 21…]]></description>
										<content:encoded><![CDATA[<p>Moribund train company Great Western Rail currently have a <strong>two month</strong> backlog of complaints.  I think that this breaches their agreement with the Office of Rail and Road.  In an ideal world GWR would be forced to improve, or be stripped of their franchise.</p>

<p>I've spent an utterly miserable month commuting between Oxford and London on GWR's over-crowded and decrepit trains.  <a href="http://greatwesternfail.tumblr.com/">I was delayed around 21 times in a single month</a>.  That's close to 80% of all journeys that I caught arriving late.  An utterly shambolic performance by anyone's standards.</p>

<p>The one faint glimmer of hope I had was the thought that I might be able to claim a tiny amount of compensation for the constant delays.  That was not to be the case.
Initially, I'd emailed the company to make the complain - only to receive back a whinging excuse that they were dealing with a large volume of complaints and that I should expect a 3 week delay before hearing back from them.</p>

<p>Even their complaints department is delayed!</p>

<p>After a month of travel, I rang up to see what had happened to my complaint.  "I'm awfully sorry sir, all our computers are down.  Try calling back later."</p>

<p>Of course, their complaints department breaks down as often as their locomotives.</p>

<p>The next day I tried again.  After 10 minutes on hold I gave up.  Then, because I'm a glutton for punishment, I tried again.  The same delays.  One more attempt - and I was through!</p>

<p>"I'm sorry sir, we currently have a two month backlog of complaints. We've only just started on September."</p>

<p>That seems like an <em>awfully</em> long delay.  I turned to the <a href="http://orr.gov.uk/">Office of Rail and Road</a> to see what their guidance to train companies says:</p>

<blockquote><p>3.31 Licence holders must provide all complainants with an acknowledgement and complaint reference/tracking number as appropriate and to make a full response to 95% of all complaints within 20 working days.
</p><p><cite>Office of Rail and Road's <a href="http://orr.gov.uk/__data/assets/pdf_file/0020/19370/complaints-handling-procedure-guidance-2015.pdf">Guidance on complaints handling procedures for licence holders, 2015</a></cite></p></blockquote>

<p>Well - a 2 month delay is <em>much</em> longer than 20 working days.  So, what powers do ORR have?</p>

<blockquote><p>The maximum penalty ORR may impose is 10% of the licensee’s turnover.
</p><p><cite>Office of Rail and Road's <a href="http://orr.gov.uk/__data/assets/pdf_file/0018/4716/economic-enforcement-statement.pdf">economic enforcement policy and penalties statement for Railway licence holders, 2015</a></cite></p></blockquote>

<p>Oh! Wouldn't that be lovely! Fine the useless layabouts and return that money to the passengers.  Sadly, that's unlikely to happen.</p>

<p>I spoke directly to ORR and they said that they are "working closely with GWR to resolve the issue."</p>

<p>I spoke to <a href="http://www.transportfocus.org.uk">TransportFocus</a> - they're the independent transport user watchdog:</p>

<blockquote><p>We are aware that they are a bit behind. But we just deal with individual complaints as they come in.</p></blockquote>

<p>I sent details of the issue to them - but they also have a backlog of GWR complaints to get through.</p>

<p>In the interest of fairness, I spoke to GWR's press team. They refused to answer any questions by phone and insisted on email.&nbsp;</p>

<blockquote><p>We’ve recently moved our contact centre to a new site, bringing all our customer service work back to the UK, and the move means some detailed responses are taking longer than we would like. We are working with our new team to improve our response rates.</p></blockquote>

<p>Ah, the good old "blame the call centre workers" tactic. Pathetic.</p>

<p>This is an unacceptable abdication of responsibility from a company.  If you have a backlog of complaints, it seems to me that there are two simple solutions:</p>

<ul>
<li>Hire more staff.</li>
<li>Fix the problems causing the complaints.</li>
</ul>

<p>I appreciate that some of the issues surrounding track maintenance are outside of GWR's control.  But their response to long-suffering customers is <em>completely</em> their fault. First Group - who own GWR - <a href="https://www.ft.com/content/127d9272-31fc-11e6-bda0-04585c31b153">made a profit of £114m last year</a>.  I suspect that they've calulated that putting barriers in the way of compensation is cheaper than fixing the underlying issues.</p>

<p>Sadly, <a href="https://www.theguardian.com/commentisfree/2016/apr/03/firstgroup-great-western-railway-advertising-standards-poster">the region is stuck with GWR for another 4 years</a>.  So, I guess I'll be taking the coach into London for the foreseeable future.</p>

<p>I'll leave you with my favourite quote from the <a href="https://www.gwr.com/about-us/our-business/passengers-charter">GWR Passenger's Charter</a>:</p>

<blockquote><p>We’ll make claiming compensation for a delayed journey as easy as we can.</p></blockquote>

<p>What a joke!</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=23654&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2016/11/great-western-rails-contempt-for-customers/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
	</channel>
</rss>
