emulate -L zsh
-if [[ -n "$1" ]]; then
+if [[ -z "$1" ]]; then
print 'Usage: weather <station_id>'
print \
'List of stations: http://en.wikipedia.org/wiki/List_of_airports_by_ICAO_code'
local DIR="${HOME}/.weather"
local LOG="${DIR}/log"
-if [[ -d ${DIR} ]]; then
+if ! [[ -d ${DIR} ]]; then
print -n "Creating ${DIR}: "
mkdir ${DIR}
print 'done'
print
cd ${DIR} && \
wget -T 10 --no-verbose --output-file=$LOG --timestamping \
- http://weather.noaa.gov/pub/data/observations/metar/decoded/$PLACE.TXT
+ https://tgftp.nws.noaa.gov/data/observations/metar/decoded/$PLACE.TXT
if [[ $? -eq 0 ]]; then
if [[ -n "$VERBOSE" ]] ; then