3 ms·
Show HN: JSON ReST Proxy for the UK National Rail Live Departure Board SOAP API
- jsingleton 12y agoTry this link to see all the arrivals at Paddington from Reading in JSON form: https://huxley.apphb.com/all/pad/from/rdg/16?accessToken=DA1C7740-9DA0-11E4-80E6-A920340000B1 https://huxley.apphb.com/all/pad/from/rdg/16?accessToken=DA1... You could also try pasting this into the browser console: var r = new XMLHttpRequest(); r.open("GET", "https://huxley.apphb.com/all/pad/from/rdg/1?accessToken=DA1C7740-9DA0-11E4-80E6-A920340000B1", true); r.onreadystatechange = function () { if (r.readyState != 4 || r.status != 200) return; var resp = JSON.parse(r.response); if (resp.trainServices && resp.trainServices.length > 0) { alert("The next train to arrive at " + resp.locationName + " from " + resp.filterLocationName + " is scheduled to get in at " + resp.trainServices[0].sta); } else { alert("Sorry, no trains from " + resp.filterLocationName + " arriving soon"); } }; r.send();