Last active
January 28, 2019 01:43
-
-
Save komasaru/9635884 to your computer and use it in GitHub Desktop.
Bash script to get a METAR information.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 引数(ICAO コード)不正なら終了 | |
if [[ ! "$1" =~ [0-9A-Z]{4} ]]; then | |
echo "Wrong argument!" | |
exit | |
fi | |
# URL("decode" データ)(以下のどちらか) | |
URL="http://weather.noaa.gov/pub/data/observations/metar/decoded/" | |
#URL="ftp://tgftp.nws.noaa.gov/data/observations/metar/decoded/" | |
# METAR 取得(以下のどちらか) | |
wget -q -O - "${URL}${1}.TXT" | |
#curl "${URL}${1}.TXT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment