diff options
author | stuebinm | 2023-11-03 00:11:05 +0100 |
---|---|---|
committer | stuebinm | 2023-11-03 00:11:05 +0100 |
commit | e66a47390c7426d322e1b845da4e6e3955b3beb6 (patch) | |
tree | 21b93ee116141f2857f80f85d3fbf80635f594e1 /home | |
parent | b1714c336bc63cb5bb8f7501f1ff8bef93b026c9 (diff) |
home: am selben bahnsteig gegenüber
experimental, will probably still break on some stations
Diffstat (limited to 'home')
-rw-r--r-- | home/home.nix | 17 |
1 files changed, 17 insertions, 0 deletions
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 = { |