npm install- ensure you have
credentials.json,google_secret.json,.envin project root - either remove require for
sampleDatainrunAttendance.jsor ensure you have one inutils/sampleData.js(only used whenDEBUG = trueinrunAttendance.js) - run script for the first time (see below) and copy the authorization link to a browser to authenticate
👉 run node runAttendance.js RPT0x RPT0y RPT0z to take live attendance of a specific cohort
👉 run node runAttendance.js LOG RPT0x RPT0y RPT0z where LOG is the first argument. Errythang is case sensitive so keep it caps.
node runAttendance.js RPT05 RPT06 // returns attendance for cohorts RPT05 and RPT06
node runAttendance.js LOG RPT05 RPT06 // logs all zoom data fetched to google sheets and returns attendance for cohorts RPT05 and RPT06
NOTE: you must be running node 8.11 and above for this script to work
- matchStudents.js is very basic in its matching. It goes for exact matches but if not it will look for parts of matches within full names. This means a common name like 'John' might be matched across several names 'Johnny Boy', as well as 'John The Great'. These matches will output as yellow, and print out what the match was for manual verification of accuracy.
- zoomHelpers.js is not clean code. One of the main constraints with Zoom API is that requests are throttled to 1 request per second. For that reason, the function
getLiveAttendancethrottles the rate at which each query is made. It could definitely be written better¯\_(ツ)_/¯
This script basically does the following:
- Fetch cohort data from
https://docs.google.com/spreadsheets/d/1zoCbN_cev7pUy-yHlIw7xpnkgsqYOTR7_8GNL6Uryok/edit#gid=1037917149where sheetAttendance Datapulls in enrolled, active students along with their zoom name if its particularly unique - Fetch live zoom participant data from the RPT zoom accounts hosting the zoom sessions
- Flattens zoom data and writes raw data fetched from zoom to
https://docs.google.com/spreadsheets/d/13QoBe1gt_bEBPp_7snEBY96xguLtjmtuVhETAUgV-O8/edit#gid=0 - Matches the students present against the students we expect based on a basic matching logic
- Prints to the console who is here with emphasis to who is ABSENT. Precarious matches are
yellow