use jq for formatting; more powerful in case we need to temporarily remove attributes

This commit is contained in:
Axel Uhl committed 2019-12-13 10:08:24 +01:00
1 parent ae4fdac197
commit 1e12367979
1 file changed
+2 -1
+2 -1
View File
@@ -40,7 +40,8 @@ if [ "$continue" != "1" ]; then
fi
download_and_fix_boatclasses () {
wget $WGET_QUIET -O - "$1/sailingserver/api/v1/leaderboardgroups/`echo $OLD_LB | sed -e 's/ /%20/g'`" | python -m json.tool | grep -v "\"id\": \"[^\"]*\"" | grep -v "\"timepoint\": \"[^\"]*\"" >"$2" 2>$WGET_ERR
wget $WGET_QUIET -O - "$1/sailingserver/api/v1/leaderboardgroups/`echo $OLD_LB | sed -e 's/ /%20/g'`" | jq 'del(.leaderboards[].series[].fleets[].races[].raceViewerUrls) | del(.events)' | grep -v "\"id\": \"[^\"]*\"" | grep -v "\"timepoint\": \"[^\"]*\"" >"$2" 2>$WGET_ERR
#wget $WGET_QUIET -O - "$1/sailingserver/api/v1/leaderboardgroups/`echo $OLD_LB | sed -e 's/ /%20/g'`" | python -m json.tool | grep -v "\"id\": \"[^\"]*\"" | grep -v "\"timepoint\": \"[^\"]*\"" >"$2" 2>$WGET_ERR
}
diff leaderboardgroups.old.sed leaderboardgroups.new.sed