Skip to content

Instantly share code, notes, and snippets.

@nathanhammond
Created March 22, 2021 03:38
Show Gist options
  • Save nathanhammond/890b5d7bb4fa6ad686e7932e1c4d729d to your computer and use it in GitHub Desktop.
Save nathanhammond/890b5d7bb4fa6ad686e7932e1c4d729d to your computer and use it in GitHub Desktop.

Monitor Available HK Vaccine Appointments

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);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment