Skip to content

Commit

Permalink
Merge pull request #71 from nycmeshnet/james/validate
Browse files Browse the repository at this point in the history
Validate Data
  • Loading branch information
james-otten authored Nov 27, 2024
2 parents bdb984c + f5371a8 commit e3cc19f
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/data/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@ set -e
# Set default value for MESHDB_HOST if not already set
: "${MESHDB_HOST:=db.nycmesh.net}"

KIOSKS_JSON=$(curl -s -f -L "http://$MESHDB_HOST/api/v1/mapdata/kiosks/?format=json")
echo $KIOSKS_JSON > kiosks.json
curl -s -f -L -o kiosks.new.json "https://$MESHDB_HOST/api/v1/mapdata/kiosks/?format=json"
jq . kiosks.new.json
mv kiosks.new.json kiosks.json

NODES_JSON=$(curl -s -f -L "http://$MESHDB_HOST/api/v1/mapdata/nodes/?format=json")
echo $NODES_JSON > nodes.json
curl -s -f -L -o nodes.new.json "https://$MESHDB_HOST/api/v1/mapdata/nodes/?format=json"
jq . nodes.new.json
mv nodes.new.json nodes.json

LINKS_JSON=$(curl -s -f -L "http://$MESHDB_HOST/api/v1/mapdata/links/?format=json")
echo $LINKS_JSON > links.json
curl -s -f -L -o links.new.json "https://$MESHDB_HOST/api/v1/mapdata/links/?format=json"
jq . links.new.json
mv links.new.json links.json

SECTORS_JSON=$(curl -s -f -L "http://$MESHDB_HOST/api/v1/mapdata/sectors/?format=json")
echo $SECTORS_JSON > sectors.json
curl -s -f -L -o sectors.new.json "https://$MESHDB_HOST/api/v1/mapdata/sectors/?format=json"
jq . sectors.new.json
mv sectors.new.json sectors.json

0 comments on commit e3cc19f

Please sign in to comment.