aboutsummaryrefslogtreecommitdiff
path: root/templates/.bin/taf
blob: 9564b95a059eae66934b0978d1df022ebd472612 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash

jq="/usr/bin/jq"
if [[ ! -x "$jq" && -x "/usr/local/bin/jq" ]]; then
  jq="/usr/local/bin/jq"
fi

station=$(echo -n "$1" | tr "a-z" "A-Z")
json=$(curl -s "https://avwx.rest/api/taf/${station:-KBOS}")
echo "$json" | "$jq" --raw-output '.["Raw-Report"]' 2>&1