Automated Trojan Check

trojancheck

Overview

During the Fall 2021 and Spring 2022 semesters, USC required a daily Trojan Check QR code to get onto campus. To receive this QR code, as shown below, one had to get a covid test biweekly and fill out a daily online questionnaire asking if you have any symptoms. Filling out this form was superficial and rather tedious. I automated this process. My Raspberry Pi ran a python script every morning that would email me my daily QR code at 8am.

trojan QR

Selenium

To automate filling out the questionnare, I used the python Selenium module. This allowed me to fill in all required fields and "click" any buttons based on the website's HTML and the elements' Xpaths. An illustration of what this automation looks like graphically is shown below.

trojan gif

SMTP

The script after filling out the questionnaire would then take a screenshot of the QR code. Next I needed a way to email this screenshot. Python has a SMTP (Simple Mail Transfer Protocol) module. This module allowed me to receive a daily email from autotrojancheck@gmail.com as shown below!

trojan_email