Skip to content

Instantly share code, notes, and snippets.

@nsonnad
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nsonnad/f62f6fe587f8b65447f6 to your computer and use it in GitHub Desktop.
Save nsonnad/f62f6fe587f8b65447f6 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Check the status of the Quartz dishwasher. This will install
# jsontool (http://trentm.com/json/) if you don't have it already.
if ! which $json >/dev/null; then
npm install -g json
fi
STATUS=$(curl -s http://api.qz.com/0/things/dishwasher/status)
DISHSTATE=$(echo $STATUS | json value.dishState)
DOORSTATUS=$(echo $STATUS | json value.doorStatus)
echo "Quartz: The dishes are ${DISHSTATE} and the door is ${DOORSTATUS}."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment