Skip to content

Instantly share code, notes, and snippets.

@mikerr
Created February 23, 2019 15:13
Show Gist options
  • Save mikerr/2ff2f2d396aa4c916274f336b0e0c831 to your computer and use it in GitHub Desktop.
Save mikerr/2ff2f2d396aa4c916274f336b0e0c831 to your computer and use it in GitHub Desktop.
show charging status of cyc EV charging stations
#!/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