Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
realtimetrains
Advanced tools
This module allows you to use the API from Realtimetrains.co.uk, which provides access to rail information across the Great British rail network.
You will need to sign up for an account to get access to the API, see the realtimetrains.co.uk API documentation for more information.
Simply install the module
npm install --save realtimetrains
The API is Promises based and, in fact, is a thin wrapper over some Axios requests.
var RealtimetrainsClient = require('realtimetrains')
var rttClient = new RealtimetrainsClient({})
rttClient.getLocationList({ 'station': 'CHX' }).then((locationList) => {
console.log(locationList.data)
})
Which will get you something like...
{ location: { name: 'London Charing Cross', crs: 'CHX', tiploc: 'CHRX' },
filter: null,
services:
[ { locationDetail: [Object],
serviceUid: 'W45286',
runDate: '2018-10-07',
trainIdentity: '2L58',
runningIdentity: '2L58',
atocCode: 'SE',
atocName: 'Southeastern',
serviceType: 'train',
isPassenger: true },
{ locationDetail: [Object],
serviceUid: 'W44809',
runDate: '2018-10-07',
trainIdentity: '1H46',
runningIdentity: '1H46',
atocCode: 'SE',
atocName: 'Southeastern',
serviceType: 'train',
isPassenger: true },
{ locationDetail: [Object],
serviceUid: 'W45368',
runDate: '2018-10-07',
trainIdentity: '2N60',
runningIdentity: '2N60',
atocCode: 'SE',
atocName: 'Southeastern',
serviceType: 'train',
isPassenger: true },
{ locationDetail: [Object],
serviceUid: 'J69441',
runDate: '2018-10-07',
trainIdentity: '2V62',
runningIdentity: '2V62',
atocCode: 'SE',
atocName: 'Southeastern',
serviceType: 'train',
isPassenger: true },
{ locationDetail: [Object],
serviceUid: 'W45287',
runDate: '2018-10-07',
trainIdentity: '2L60',
runningIdentity: '2L60',
atocCode: 'SE',
atocName: 'Southeastern',
serviceType: 'train',
isPassenger: true },
{ locationDetail: [Object],
serviceUid: 'W44810',
runDate: '2018-10-07',
trainIdentity: '1H48',
runningIdentity: '1H48',
atocCode: 'SE',
atocName: 'Southeastern',
serviceType: 'train',
isPassenger: true },
{ locationDetail: [Object],
serviceUid: 'W45371',
runDate: '2018-10-07',
trainIdentity: '2N66',
runningIdentity: '2N66',
atocCode: 'SE',
atocName: 'Southeastern',
serviceType: 'train',
isPassenger: true },
{ locationDetail: [Object],
serviceUid: 'J69442',
runDate: '2018-10-07',
trainIdentity: '2V64',
runningIdentity: '2V64',
atocCode: 'SE',
atocName: 'Southeastern',
serviceType: 'train',
isPassenger: true } ] }
The methods are very light wrappers around the Realtimetrains Pull api
All methods accept an object for specifying the query.
getLocationList
See the LocationList documentation
You must specify a station, and can optionally specify a toStation OR a date/time
rttClient.getLocationList({
'station': 'CHX' // the station to get the location list for
'date': '2018/09/08' // the date to filter on, in YYYY/MM/DD format
'time': '0900' // the time in HHMM format
})
OR
rttClient.getLocationList({
'station': 'CHX' // the station to get the location list for
'toStation': 'CBW' // filter out service to this location
})
getService
Retrieve a service using it's service UID and running Date
rttClient.getService({
'service' : 'W45286', // the serviceUid
'date': '2018/10/07' // the date on which it runs in YYYY/MM/DD format
})
FAQs
A module to query the Realtimetrains.co.uk Pull API
The npm package realtimetrains receives a total of 0 weekly downloads. As such, realtimetrains popularity was classified as not popular.
We found that realtimetrains demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.