From e66a47390c7426d322e1b845da4e6e3955b3beb6 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Fri, 3 Nov 2023 00:11:05 +0100 Subject: home: am selben bahnsteig gegenüber experimental, will probably still break on some stations --- home/home.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/home/home.nix b/home/home.nix index 3a5ff9c..3e854e6 100644 --- a/home/home.nix +++ b/home/home.nix @@ -131,6 +131,23 @@ functions.nix-what.body = '' nix-doc search $argv[1] ~/clones/nixpkgs ''; + functions.bahnsteig.body = '' + set station (echo $argv) + if string upper -q $station + set name (string escape --style=url $station) + set station (curl -sL https://ril100.bahnhof.name/$name) + echo ril100 $station + end + curl -s https://overpass-api.de/api/interpreter -d " + [out:json][timeout:25]; + node[~\"railway:ref|railway:ref:parent\"~\"^$station\$\"][operator~\"^(DB |Deutsch)\"]; + rel[public_transport~\"stop_area|stop_area_group\"](bn) -> .a; + rel[public_transport~\"stop_area|stop_area_group\"](br.a) -> .b; + (.a;.b;); + nwr[railway=platform](>>); + out; + " | jq '.elements[].tags.ref | select(. != null)' | sort + ''; }; programs.kitty = { -- cgit v1.2.3