Needed software: curl, node, watch.
watch ./appointments.sh
| date +"%Y-%m-%dT%H:%M:%S%z" | |
| # CUSTOMIZE: Insert your own desired facilities here. | |
| # Grab your IDs from here: https://booking.covidvaccine.gov.hk/forms/ct_center | |
| # Add as many as you want. | |
| ### EXAMPLES | |
| # St Paul: 44 | |
| echo "St. Paul's - Wan Chai" | |
| node ~/cvc.js `curl --silent 'https://bookingform.covidvaccine.gov.hk/forms/api_center' --data-raw 'center_id=44&cv_ctc_type=CVC&cv_name=BioNTech%2FFosun'` | |
| # HKSH: 35 | |
| echo "HKSH - Wan Chai" | |
| node ~/cvc.js `curl --silent 'https://bookingform.covidvaccine.gov.hk/forms/api_center' --data-raw 'center_id=35&cv_ctc_type=CVC&cv_name=BioNTech%2FFosun'` |
| var response = JSON.parse(process.argv.slice(2).join(' ')); | |
| var days = response.avalible_timeslots | |
| // CUSTOMIZE: Set up your day filter here. | |
| var filteredDays = days.filter(function(day) { | |
| return day.date < '2021-03-27'; | |
| }); | |
| // CUSTOMIZE: Set up your time filter here. | |
| filteredDays.forEach(function(day) { | |
| var date = day.date; | |
| var timeslots = day.timeslots.filter((timeslot) => timeslot.value !== 0); | |
| console.log(date); | |
| console.log(timeslots); | |
| }); |