Small pet project that syncs time records from Hamster tracker to Everhour. Most likely, it will not be of any use except myself. It relies on the everhour-simple-client crate, that I've created specifically for this purpose.
Locally, I'm using Hamster to track and plan my activity, while on my job I'm required to track my working time in Everhour. To avoid doing tracking double and also to learn some Rust - this project was created.
For adding time record entry in Everhour, this data is required:
-
Everhour API token: can be obtained one the Everhour User Profile settings page. Can be specified via
--api-token
command line option orEVERHOUR_API_TOKEN
environment variable. -
task id
- in Hamster, for work task entries' description, I add links to Asana tasks in markdown format. Task ids are extracted from these links -
user
- current user, obtained by relevant API call -
time
- time in seconds, calculated by the task duration, i.e.end_time
-start_time
. If end time is not defined, current time is used -
date
- date of the task. Currently, tasks that span for more than 1 day, are not processed properly!
Basic example of running the sync:
ham-cli sync-eh Work
…will sync tasks of Work
category for today. The command above assumes that:
- Hamster database is located in
$HOME/.local/share/hamster/hamster.db
- Everhour API token is set in
EVERHOUR_API_TOKEN
env variable (see above)