diff options
author | Asa Venton <asav1410@gmail.com> | 2019-10-20 13:59:47 +0100 |
---|---|---|
committer | Asa Venton <asav1410@gmail.com> | 2019-10-20 13:59:47 +0100 |
commit | d4c5c1c082aaaa75b87268223dcf2653b7b5a9a5 (patch) | |
tree | 25991a567acfd0993c54d0dccfbd9fa9bef723c4 | |
parent | a9edb73192660992d0a6b52be935db84f3759f82 (diff) |
Fix trailing comma on result, add TODOs
-rwxr-xr-x | livetimes.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/livetimes.sh b/livetimes.sh index 6dfcfb5..9c9d7bd 100755 --- a/livetimes.sh +++ b/livetimes.sh @@ -8,9 +8,9 @@ _jq() { echo ${json} | base64 --decode | jq -r ${1} } +# TODO: efficiency of _liveresult? _liveresult() { livetimes=$(curl --silent https://admin.libertybus.je/api/v1/soj/stop_updates/${stop}) - # doesn't work without encoding in base64 (why?) result="$result Dest: " for json in $(echo "${livetimes}" | jq -r '.[] | @base64'); do result="$result $(_jq '.destination'), " @@ -24,7 +24,7 @@ _liveresult() { result="$result | ETAs: " for json in $(echo "${livetimes}" | jq -r '.[] | @base64'); do result="$result $(_jq '.eta'), " - result=$(echo $result | sed 's/, $//') + result=$(echo $result | sed 's/,$//') done echo -e $result exit 0 |