Created
February 23, 2019 15:13
-
-
Save mikerr/2ff2f2d396aa4c916274f336b0e0c831 to your computer and use it in GitHub Desktop.
show charging status of cyc EV charging stations
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/bash | |
# show charging status of cyc EV charging stations | |
# chargeyourcar.org.uk | |
# usage: cyc-status 70808 | |
html=$(curl -s https://m.chargeyourcar.org.uk/chargePoint?bayNo=$1) | |
name=$(grep -m1 "<br />" <<< $html | tr -d "\t" | cut -d "<" -f1) | |
status=$(grep "connectorStatusArray\\[connectorIndex\\] =" <<< $html | cut -d\' -f2) | |
echo $name | |
echo $status |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment