summary refs log tree commit diff
diff options
context:
space:
mode:
authoruser@node5.net <user@node5.net>2025-05-04 13:28:22 +0200
committeruser@node5.net <user@node5.net>2025-05-04 13:28:22 +0200
commitc00b3f0fabda75e23a986f125d06d0a250752b0f (patch)
treebf50d8ebfdc8ab73b01c392078e1a30df7d2e039
parentfcce732a5d5daa68608356e76f80521ac37a68c2 (diff)
Transit timetable display - Rejseplanen API POC + Rename article
Rename article: Train timetable display -> Transit departure display
-rw-r--r--Train timetable display/index.md7
-rw-r--r--Transit departure display/POC.webp (renamed from Train timetable display/POC.webp)bin56858 -> 56858 bytes
-rw-r--r--Transit departure display/Thumbnail.webp (renamed from Train timetable display/Thumbnail.webp)bin5626 -> 5626 bytes
-rw-r--r--Transit departure display/index.md70
4 files changed, 70 insertions, 7 deletions
diff --git a/Train timetable display/index.md b/Train timetable display/index.md
deleted file mode 100644
index eb32cac..0000000
--- a/Train timetable display/index.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-description: Train departure display
-created: 2025-03-30
----
-
-![POC](POC.webp)
-
diff --git a/Train timetable display/POC.webp b/Transit departure display/POC.webp
index 5f1e147..5f1e147 100644
--- a/Train timetable display/POC.webp
+++ b/Transit departure display/POC.webp
Binary files differdiff --git a/Train timetable display/Thumbnail.webp b/Transit departure display/Thumbnail.webp
index 7ef1b50..7ef1b50 100644
--- a/Train timetable display/Thumbnail.webp
+++ b/Transit departure display/Thumbnail.webp
Binary files differdiff --git a/Transit departure display/index.md b/Transit departure display/index.md
new file mode 100644
index 0000000..eadd434
--- /dev/null
+++ b/Transit departure display/index.md
@@ -0,0 +1,70 @@
+---
+description: Public transit time table
+created: 2025-03-30
+---
+
+![POC](POC.webp)
+
+## Data POC
+
+### mittog.dk
+
+- https://mittog.dk/da/departures/KH/stog
+- https://github.com/vi/websocat
+
+```console
+websocat 'wss://api.mittog.dk/api/ws/stog/departure/KH/dinstation/' -B 500000 | jq
+```
+
+It's easily scrapable, but doesn't provide bus depature times.
+
+### rejseplanen API
+
+Journey planner however can be used for both trains and busses
+
+- You can find the API at: [labs.rejseplanen.dk](https://labs.rejseplanen.dk/)
+- [Rejseplanen api departure board endpoint documentation](https://www.rejseplanen.dk/api/departureBoard?wadl)
+- The list of stop IDs can be aquired from the [GTFS.zip](https://www.rejseplanen.info/labs/GTFS.zip) file
+
+```bash
+curl 'https://www.rejseplanen.dk/api/departureBoard?accessId=XXX&format=json&id=000008600646' > nørreport_st.json
+cat nørreport_st.json | jq '.Departure | .[] | {name: .name, planned_time: .time, direction: .direction, actual_time: .rtTime}' | jq --slurp
+```
+
+```JSON
+  {
+    "name": "Re 1070",
+    "direction": "Helsingborg C",
+    "planned_time": "12:53:00",
+    "actual_time": null
+  },
+  {
+    "name": "C",
+    "direction": "Frederikssund St.",
+    "planned_time": "12:53:00",
+    "actual_time": null
+  },
+  {
+    "name": "Metro M2",
+    "direction": "Vanløse",
+    "planned_time": "12:54:37",
+    "actual_time": null
+  },
+  {
+    "name": "Bus 5C",
+    "direction": "Sundbyvester Plads",
+    "planned_time": "12:55:00",
+    "actual_time": "12:58:00"
+  },
+  {
+    "name": "Bus 5C",
+    "direction": "Husum Torv",
+    "planned_time": "12:55:00",
+    "actual_time": "12:53:00"
+  },
+```
+
+Here we get trains, s-trains, busses and the metro.<br>
+With name, direction planned time, and delay / ahead times.<br>
+nice!
+