summary refs log tree commit diff
path: root/Transit departure display/index.md
diff options
context:
space:
mode:
Diffstat (limited to 'Transit departure display/index.md')
-rw-r--r--Transit departure display/index.md70
1 files changed, 70 insertions, 0 deletions
diff --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!
+