Skip to content

Instantly share code, notes, and snippets.

@jrolfs
Last active August 29, 2015 13:57
Show Gist options
  • Save jrolfs/9499491 to your computer and use it in GitHub Desktop.
Save jrolfs/9499491 to your computer and use it in GitHub Desktop.
Shell script for monitoring GitHub status (with emoji cats).
#!/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
@jrolfs
Copy link
Author

jrolfs commented Mar 12, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment