Live train data from headcode #42

Open
opened 2023-09-22 14:05:13 +01:00 by owlbot · 1 comment
Collaborator

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Browser: Netscape
BrowserVersion: 5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Platform: Linux x86_64
Viewport: 1280 x 652

User Message:
The addition of live train data to the timetable lookup by headcode feature would be great, allowing people to easily lookup a specific trains running details with just the headcode.

To do this, the RID will need to be calculated like this:

"
To get the RID, replace the leading character of the UID with its ASCII ordinal value and prefix with today's date as YYYYMMDD so for your example train W27417, today's running has RID 202307078727417
"

From 'OpenRailData' Google Group

Fetching the ASCII code point of a character is as simple as:

var s = 'A';
console.log(s.charCodeAt(0));
// 65

It may be ideal to send the calulated RID along with the timetable data rather than calculate it client-side. This is simply to make it easier to implement on alternative clients if/when they are written.

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Browser: Netscape BrowserVersion: 5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Platform: Linux x86_64 Viewport: 1280 x 652 User Message: The addition of live train data to the timetable lookup by headcode feature would be great, allowing people to easily lookup a specific trains running details with just the headcode. To do this, the RID will need to be calculated like this: " To get the RID, replace the leading character of the UID with its ASCII ordinal value and prefix with today's date as YYYYMMDD so for your example train W27417, today's running has RID 202307078727417 " From 'OpenRailData' Google Group Fetching the ASCII code point of a character is as simple as: ``` var s = 'A'; console.log(s.charCodeAt(0)); // 65 ``` It may be ideal to send the calulated RID along with the timetable data rather than calculate it client-side. This is simply to make it easier to implement on alternative clients if/when they are written.
owlbot added the
enhancement
web-user
labels 2023-09-22 14:05:13 +01:00

The RID conversion should be sent as part of the response for timetable data. Then, a client can simply request the live data to supplement the timetable data.

The client should display a button so a user can request the live data. This saves upstream API queries and loading data that a user may not need.

The RID conversion should be sent as part of the response for timetable data. Then, a client can simply request the live data to supplement the timetable data. The client should display a button so a user can request the live data. This saves upstream API queries and loading data that a user may not need.
fred.boniface added the
web-frontend
backend
labels 2023-09-22 14:09:41 +01:00
fred.boniface added this to the Feb 2023 Release milestone 2023-11-09 14:40:42 +00:00
Sign in to join this conversation.
No description provided.