Checks SPO (Students' Placement Office, IITK) site for information on new announcements / pre-placement talks / tests / interviews at regular intervals, notifies through e-mail
These are the required packages, might need to be installed using
pip3 install <package-name>
python-dotenv
for managing environment variablesselenium
for automation of browser loginlogging
to ease up debugging processsmtplib
for connecting to outlook (host e-mail account), sending messageemail
for managing email format
Also, the chromedriver executable is required, for selenium to use (in a headless way) to initiale login. This can be downloaded at this site.
This file is to be downloaded, and run using crontab
for linux/mac users, schtasks
for windows users
Crontab entry is to be added to run the file regularly
To edit crontab entries:
crontab -e
Add below cronjob after executing above command:
0 * * * * /path/to/python3 /path/to/notification_generator.py
To view crontab entries:
crontab -l
schtasks /create /sc hourly /st 00:00 /tn "Gen_Notif" /tr \path\to\python3 \path\to\notification_generator.py
This file is to be stored locally in the same folder as the notification_generator.py.
It should be populated with the following variables:
EMAIL_ID
,EMAIL_PWD
-> email and password to login into email account and send emailsPORTAL_USR
,PORTAL_PWD
-> portal user-id and password
Note: the host email set is of Outlook. This can be changed to other hosts by changing the smtp url
PATH variable passed to crontab might not match!
This might lead to python run command working in terminal, but not using crontab.
To resolve this error, set your path before crontab entries (add below line before python execution command).
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
For more crontab related issues visit this page