diff options
author | Ben Burwell <ben@benburwell.com> | 2019-08-13 14:40:54 -0400 |
---|---|---|
committer | Ben Burwell <ben@benburwell.com> | 2019-08-13 14:40:54 -0400 |
commit | c09d91fe95fca4367f47c06fc808cd02a1a8e6a5 (patch) | |
tree | 6c5c8dee0c219ab701dc1ff4c39e905dbac08e70 /templates/.bin/taf |
add bins
Diffstat (limited to 'templates/.bin/taf')
-rwxr-xr-x | templates/.bin/taf | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/templates/.bin/taf b/templates/.bin/taf new file mode 100755 index 0000000..9564b95 --- /dev/null +++ b/templates/.bin/taf @@ -0,0 +1,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 + |