traewelling: add token support
This commit is contained in:
parent
5e0acac0bb
commit
5202f6ed39
1 changed files with 5 additions and 1 deletions
|
@ -15,7 +15,11 @@ pkgs.writeShellScriptBin "traewelling" ''
|
|||
user="$1"
|
||||
fi
|
||||
|
||||
json="$(curl -s "https://traewelling.de/api/v1/user/$user/statuses" | jq .data[0])"
|
||||
if ! [ -e ~/sync/traewelling.token ] ; then
|
||||
exit
|
||||
fi
|
||||
|
||||
json="$(curl -s -H "Authorization: $(cat ~/sync/traewelling.token)" "https://traewelling.de/api/v1/user/$user/statuses" | jq .data[0])"
|
||||
if [ "$(($(date -d "$(j .train.destination.arrival)" +%s) - $(date +%s) ))" -gt 0 ] ; then
|
||||
color 9
|
||||
echo "> Traewelling"
|
||||
|
|
Loading…
Add table
Reference in a new issue