mirror of
https://github.com/kmein/niveum
synced 2026-03-18 02:51:08 +01:00
feat(bin): add tuesday script
This commit is contained in:
15
.bin/tuesday-1800
Executable file
15
.bin/tuesday-1800
Executable file
@@ -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]
|
||||||
|
'
|
||||||
Reference in New Issue
Block a user