- Python3
- requests
- lxml
-
Make sure you have installed the dependencies.
$ pip3 install requests lxml -
Set these parameters in config.py
Parameters description account Account on Portal password Password on Portal PartTimeId Get from the url of the page you clock in/out AttendWork Job content DayofWeek_Clock Weekday you want to clock in/out, 0 is Monday and 6 is Sunday -
Set the script executable.
$ sudo chmod 777 Auto_clock/clock_in.py $ sudo chmod 777 Auto_clock/clock_out.py -
Time calibration.
-
Config the crontab.
$ crontab -e # minute hour day month dayofweek COMMAND 0 8 1-7 * * python3 /PATH/TO/Auto_clock/clock_in.py 2 18 1-7 * * python3 /PATH/TO/Auto_clock/clock_out.py # For example, 50 hours per month.