-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
19 lines (16 loc) · 1.18 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash -e
newData=`curl -s https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_hour.geojson`
echo $newData | jq '.features[]' | jq '[.properties.place, .geometry.coordinates[0,1], .properties.mag]' | jq '((.[2]|tostring) + "|" + (.[1]|tostring) + "|" + .[0] + "|" + (.[3]|tostring))' | jq -r . > hour.chi
./cliapp -i hour.chi --dataset-name 'all_hour'
rm hour.chi
echo "Dataset 'all_hour' created."
newData=`curl -s https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.geojson`
echo $newData | jq '.features[]' | jq '[.properties.place, .geometry.coordinates[0,1], .properties.mag]' | jq '((.[2]|tostring) + "|" + (.[1]|tostring) + "|" + .[0] + "|" + (.[3]|tostring))' | jq -r . > hour.chi
./cliapp -i hour.chi --dataset-name 'all_day'
rm hour.chi
echo "Dataset 'all_day' created."
newData=`curl -s https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.geojson`
echo $newData | jq '.features[]' | jq '[.properties.place, .geometry.coordinates[0,1], .properties.mag]' | jq '((.[2]|tostring) + "|" + (.[1]|tostring) + "|" + .[0] + "|" + (.[3]|tostring))' | jq -r . > hour.chi
./cliapp -i hour.chi --dataset-name 'all_week'
rm hour.chi
echo "Dataset 'all_week' created."