Last active
August 29, 2015 13:57
-
-
Save jrolfs/9499491 to your computer and use it in GitHub Desktop.
Shell script for monitoring GitHub status (with emoji cats).
This file contains 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/sh | |
while : | |
do | |
api_response=$(http https://status.github.com/api/status.json) | |
gh_status=$(echo "$api_response" | jq ".status" | sed "s/\"//g") | |
gh_at=$(date -v $(date +%z)H -jf "%Y-%m-%dT%H:%M:%SZ" $(echo "$api_response" | jq ".last_updated" | sed "s/\"//g")) | |
case $gh_status in | |
"good") | |
cat="😸";; | |
"minor") | |
cat="😿";; | |
"major") | |
cat="🙀";; | |
esac | |
printf "GitHub is $cat as of $gh_at\r" | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
preview