-
-
Save ecesar88/7cea9cc7b5767782d5f27b2dd26d1e83 to your computer and use it in GitHub Desktop.
Bash script to get a METAR information.
This file contains hidden or 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