From cdf42df7c19301d409d374e5848c80e34560866e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Mon, 26 Sep 2022 09:40:12 +0200 Subject: [PATCH] feat(bin): add tuesday script --- .bin/tuesday-1800 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 .bin/tuesday-1800 diff --git a/.bin/tuesday-1800 b/.bin/tuesday-1800 new file mode 100755 index 0000000..91133e7 --- /dev/null +++ b/.bin/tuesday-1800 @@ -0,0 +1,15 @@ +#!/bin/sh +expected_max_results=1024 # the upper bound on the number of restaurants +radius=500 + +echo '[out:json];node(id:260050809)->.cbase; +( + way(around.cbase:'$radius')[amenity=restaurant]; + node(around.cbase:'$radius')[amenity=restaurant]; +);out;' \ + | curl -sSL -d @- -X POST http://overpass-api.de/api/interpreter \ + | jq --argjson random "$(shuf -i 0-$expected_max_results -n 1)" ' + .elements + | length as $length + | .[$random % $length] + '