Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- WBNURL="https://informatics-stage.health.mil/WiesbadenCOVIDApp/COVIDCalendarLarge.aspx"
- LRMCURL="https://informatics-stage.health.mil/LRMCCOVIDApp/COVIDCalendarLarge.aspx"
- BAUMURL="https://informatics-stage.health.mil/BaumholderClinicCOVIDApp/COVIDCalendarLarge.aspx"
- : '
- Download the html and condense to just the block of code containing the dates for the defined
- month and then delete all of that remaining line before and then after the desired dates
- '
- COVIDPAGE=$(curl -k $WBNURL -s | sed -e '1,/Go to the previous month/d' | sed '/May 8/q' | sed 's/.*\"April 27">27<\/a><\/font><\/td>//' | sed 's/"April 29">29<\/a><\/font><\/td>.*//') #> 1.html
- : '
- Grep the remaining html for the dates with the hex color code matching appointments available.
- Send an email if the matching hex color code is found
- '
- if echo $COVIDPAGE | grep -q 289BC8; then
- echo "Wiesbaden has appointments on 17-27 May 2021. visit at $WBNURL" | mail -s "Open Appointments" $CLOUDFLARE_EMAIL
- echo "WBN" $COVIDPAGE #test code only
- fi
- COVIDPAGE=$(curl -k $LRMCURL -s | sed -e '1,/Go to the previous month/d' | sed '/May 8/q' | sed 's/.*\"April 27">27<\/a><\/font><\/td>//' | sed 's/"April 29">29<\/a><\/font><\/td>.*//') #> 1.html
- : '
- Grep the remaining html for the dates with the hex color code matching appointments available.
- Send an email if the matching hex color code is found
- '
- if echo $COVIDPAGE | grep -q 289BC8; then
- echo "Wiesbaden has appointments on 17-27 May 2021. visit at $LRMCURL" | mail -s "Open Appointments" $CLOUDFLARE_EMAIL
- echo "LRMC" $COVIDPAGE #test code only
- fi
- COVIDPAGE=$(curl -k $BAUMURL -s | sed -e '1,/Go to the previous month/d' | sed '/May 8/q' | sed 's/.*\"April 26">26<\/a><\/font><\/td>//' | sed 's/"April 29">29<\/a><\/font><\/td>.*//') #> 1.html
- : '
- Grep the remaining html for the dates with the hex color code matching appointments available.
- Send an email if the matching hex color code is found
- '
- if echo $COVIDPAGE | grep -q 289BC8; then
- echo "Baumholder has appointments on 17-27 May 2021. visit at $BAUMURL" | mail -s "Open Appointments" $CLOUDFLARE_EMAIL
- echo "LRMC" $COVIDPAGE #test code only
- fi
Advertisement
Add Comment
Please, Sign In to add comment