From: Cian Bagshaw Date: Sun, 26 Mar 2023 11:23:38 +0000 (+0100) Subject: Tidied sync function X-Git-Url: https://tests.cianb.xyz/?a=commitdiff_plain;h=f6975bf9697a0b8d604b1396bcbcccc6dea648a8;p=buseir Tidied sync function --- diff --git a/buseir b/buseir index 36a5d12..2c01b9a 100755 --- a/buseir +++ b/buseir @@ -8,10 +8,10 @@ MAP=http://www.google.com/maps/place sync() { echo Syncing data... [ ! -d $TMP ] && mkdir -p $TMP - wget "$SITE/inc/proto/bus_stop_points.php" -qO $TMP/busp \ + wget "$SITE/inc/proto/bus_stop_points.php" -qO $TMP/stops \ || (echo Connection failed! && exit); - head -c -1 $TMP/busp | tail -c +27 | jq -r '.bus_stops|.[]|.[]' \ - | paste -d "," - - - - - > "$CACHE"/stops.csv; + grep -o "{.*}" $TMP/stops | jq -r '.bus_stops[][]' \ + | paste -d, - - - - - > $CACHE/stops.csv } stopInfo() {