SHARE
TWEET

Untitled

Heroes_Killer Jun 4th, 2020 998 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. workspace_id=1234567
  2. API_TOKEN=bflmpsvz007
  3.  
  4. year=`date +%Y`
  5. month=`date +%m`
  6. url="https://toggl.com/reports/api/v2/summary?workspace_id=${workspace_id}&since=${year}-${month}-01&user_agent=toggl_hours"
  7.  
  8. toggled_ms=`curl -s -u ${API_TOKEN}:api_token -X GET "${url}" | json_pp | grep total_grand | tr -dc '0-9'`
  9.  
  10. 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)
  11.  
  12. result=`echo $(($toggled_ms / 3600000)) / $month_hours`
  13.  
  14. echo $result
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top