Skip to content

Instantly share code, notes, and snippets.

@tjstebbing
Created February 11, 2019 06:05
Show Gist options
  • Select an option

  • Save tjstebbing/a4e0b1f92ce7a42bab9c29a9c0d06ead to your computer and use it in GitHub Desktop.

Select an option

Save tjstebbing/a4e0b1f92ce7a42bab9c29a9c0d06ead to your computer and use it in GitHub Desktop.
#!/bin/bash
#apt-get install html-xml-utils
bridgeURL="http://howmanydayssincemontaguestreetbridgehasbeenhit.com"
hookURL="http://example.com"
days=$(echo "$bridgeURL" | \
wget -O- -i- 2>/dev/null | hxnormalize -x | hxselect -i '.day_box' \
| grep -o -E '[0-9+]')
echo "Days since crash $days"
if [[ $days == 0 ]]; then
echo "calling hook"
wget $hookURL
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment