#!/bin/sh
# $Id: scrape-MDAPI-0-stationlists.sh 7384 2020-12-23 19:24:26Z flaterco $
# Get all tide and current sub station offsets using new MDAPI.
# API documented at: https://api.tidesandcurrents.noaa.gov/mdapi/prod/
# If it should go away, there is another one at https://opendap.co-ops.nos.noaa.gov/ioos-dif-sos/
#
# 2017-12-29 19:25  Replaced "v0.6" with "latest"
# 2018-12-24 16:50  http to https
wget --progress=dot -O tides.json "https://api.tidesandcurrents.noaa.gov/mdapi/prod/webapi/stations.json?type=tidepredictions&expand=notices,disclaimers,tidepredoffsets"
sleep 5
wget --progress=dot -O currents.json  "https://api.tidesandcurrents.noaa.gov/mdapi/prod/webapi/stations.json?type=currentpredictions&expand=notices,disclaimers,currentpredictionoffsets"
sleep 5
wget --progress=dot -O harcon.json "https://api.tidesandcurrents.noaa.gov/mdapi/prod/webapi/stations.json?type=harcon&expand=notices,disclaimers"
