From 938452b89892c034bfa3b56c5103503031b771e9 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Sun, 17 Oct 2021 13:07:26 +0200 Subject: [PATCH] renamed mkEvents.csh to fetchEvents.sh, set default values default values: * starttime ($1): 6 month ago if date / gdate works, today otherwise * output file ($2): stdout --- scripts/fetchEvents.sh | 14 ++++++++++++++ scripts/mkEvents.csh | 4 ---- 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100755 scripts/fetchEvents.sh delete mode 100755 scripts/mkEvents.csh diff --git a/scripts/fetchEvents.sh b/scripts/fetchEvents.sh new file mode 100755 index 0000000..0848b87 --- /dev/null +++ b/scripts/fetchEvents.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# get starting date +# find gdate or date command ( OSX: brew install coreutils) +# the date command on OSX is not compatible to the linux date command +datecmd=$((which gdate || which date )| grep bin) +STIME="${1:-$(${datecmd} -d 6-month-ago +%Y-%m-%d)}" +STIME="${STIME:-$(date +%Y-%m-%d)}" + +# get output filename +OUTPUT="${2:--}" + +# fetch events +curl -s -o ${OUTPUT} "https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?starttime=${STIME}&minlat=50.0&maxlat=53.0&minlon=4.0&maxlon=10.0&minmag=0.7" diff --git a/scripts/mkEvents.csh b/scripts/mkEvents.csh deleted file mode 100755 index 46f6cd4..0000000 --- a/scripts/mkEvents.csh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -STIME=$1 -curl -o events.xml "https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?starttime=${STIME}&orderby=time&minlat=50.92&maxlat=52.76&minlon=4.26&maxlon=9.74&minmag=1.1"