This program will automatically submit this week’s time sheet for approval. It
is intended to be run automatically by launchd
or cron
. The time sheet
will only be submitted if at least one time entry has been added for every
weekday in the week.
By automating time sheet submission, the program frees human time loggers from having to remember or worry about doing so.
This script is implemented with Selenium using Firefox’s headless mode (or another browser, if you prefer). At the time of implementation, no API exists to submit time sheets for approval, and authenticity tokens made it difficult to use regular HTTP requests, leaving Selenium the only remaining option.
Clone the repository
Install dependencies:
$ pipenv install
(OS X only) Modify the
com.teddywing.harvester-submit-week-for-approval.plist
file:Change the executable path to the virtualenv’s
python3
Use the absolute path to
harvester_submit_week_for_approval.py
Fill in your Harvest account details. A developer token can be obtained at https://id.getharvest.com/developers.
Put the plist in
~/Library/LaunchAgents/
Load the plist with:
launchctl load /path/to/com.teddywing.harvester-submit-week-for-approval.plist
Download geckodriver
- Replace the
geckodriver
path on this line with the absolute path to the executable on your machine.
- Replace the
Copyright © 2018 Teddy Wing. Licensed under the GNU GPLv3+ (see the included COPYING file).