summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2022-12-13 19:54:21 +0100
committerlassulus <lassulus@lassul.us>2022-12-13 19:54:21 +0100
commit1d7766e6951edfdff2c1c0cbb601742c44da810e (patch)
tree158b940e9c68dd97f2a45123d93db1d69cea7e86
parent1ded462e7cc7800efbc2224662ab8d086bb3c02f (diff)
reaktor2 krebsfood: try all the overpass api endpoints
-rw-r--r--krebs/2configs/reaktor2.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/krebs/2configs/reaktor2.nix b/krebs/2configs/reaktor2.nix
index 8a6bd455c..9bcee6fbd 100644
--- a/krebs/2configs/reaktor2.nix
+++ b/krebs/2configs/reaktor2.nix
@@ -303,7 +303,18 @@ let
longitude=$(echo "$poi" | jq -r .longitude)
fi
- restaurant=$(osm-restaurants --radius "$2" --latitude "$latitude" --longitude "$longitude")
+ for api_endpoint in \
+ https://lz4.overpass-api.de/api/interpreter \
+ https://z.overpass-api.de/api/interpreter \
+ https://maps.mail.ru/osm/tools/overpass/api/interpreter \
+ https://overpass.openstreetmap.ru/api/interpreter \
+ https://overpass.kumi.systems/api/interpreter
+ do
+ restaurant=$(osm-restaurants --endpoint "$api_endpoint" --radius "$2" --latitude "$latitude" --longitude "$longitude")
+ if [ "$?" -eq 0 ]; then
+ break
+ fi
+ done
printf '%s' "$restaurant" | tail -1 | jq -r '"How about \(.tags.name) (https://www.openstreetmap.org/\(.type)/\(.id)), open \(.tags.opening_hours)?"'
'';
};