Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- workspace_id=1234567
- API_TOKEN=bflmpsvz007
- year=`date +%Y`
- month=`date +%m`
- url="https://toggl.com/reports/api/v2/summary?workspace_id=${workspace_id}&since=${year}-${month}-01&user_agent=toggl_hours"
- toggled_ms=`curl -s -u ${API_TOKEN}:api_token -X GET "${url}" | json_pp | grep total_grand | tr -dc '0-9'`
- month_hours=$(case $month in 05) echo 152 ;; 06) echo 176 ;; 07) echo 176 ;; 08) echo 168 ;; 09) echo 168 ;; 10) echo 168 ;; 11) echo 160 ;; 12) echo 168 ;; esac)
- result=`echo $(($toggled_ms / 3600000)) / $month_hours`
- echo $result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement