Plaidstallion

covid-appointment-page-checker

Apr 23rd, 2021
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. WBNURL="https://informatics-stage.health.mil/WiesbadenCOVIDApp/COVIDCalendarLarge.aspx"
  4. LRMCURL="https://informatics-stage.health.mil/LRMCCOVIDApp/COVIDCalendarLarge.aspx"
  5. BAUMURL="https://informatics-stage.health.mil/BaumholderClinicCOVIDApp/COVIDCalendarLarge.aspx"
  6. : '
  7. Download the html and condense to just the block of code containing the dates for the defined
  8. month and then delete all of that remaining line before and then after the desired dates
  9. '
  10.  
  11. 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
  12.  
  13. : '
  14. Grep the remaining html for the dates with the hex color code matching appointments available.
  15. Send an email if the matching hex color code is found
  16. '
  17.  
  18. if echo $COVIDPAGE | grep -q 289BC8; then
  19. echo "Wiesbaden has appointments on 17-27 May 2021. visit at $WBNURL" | mail -s "Open Appointments" $CLOUDFLARE_EMAIL
  20. echo "WBN" $COVIDPAGE #test code only
  21. fi
  22.  
  23. 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
  24.  
  25. : '
  26. Grep the remaining html for the dates with the hex color code matching appointments available.
  27. Send an email if the matching hex color code is found
  28. '
  29.  
  30. if echo $COVIDPAGE | grep -q 289BC8; then
  31. echo "Wiesbaden has appointments on 17-27 May 2021. visit at $LRMCURL" | mail -s "Open Appointments" $CLOUDFLARE_EMAIL
  32. echo "LRMC" $COVIDPAGE #test code only
  33. fi
  34.  
  35. 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
  36.  
  37. : '
  38. Grep the remaining html for the dates with the hex color code matching appointments available.
  39. Send an email if the matching hex color code is found
  40. '
  41.  
  42. if echo $COVIDPAGE | grep -q 289BC8; then
  43. echo "Baumholder has appointments on 17-27 May 2021. visit at $BAUMURL" | mail -s "Open Appointments" $CLOUDFLARE_EMAIL
  44. echo "LRMC" $COVIDPAGE #test code only
  45. fi
Advertisement
Add Comment
Please, Sign In to add comment