Created
September 19, 2022 12:07
-
-
Save haideralipunjabi/c69eb2b2c2ed1c57f054991081b0c2af to your computer and use it in GitHub Desktop.
Small Script to fetch details from Wakatime API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
API_KEY="<API-KEY>" | |
ENCODED_KEY=`echo $API_KEY | base64` | |
HEADER="Authorization: Basic $ENCODED_KEY" | |
TODAY=`date +%Y-%m-%d` | |
YESTERDAY=`date -d "yesterday" +%Y-%m-%d` | |
URL="https://wakatime.com/api/v1/users/current/summaries?start=$YESTERDAY&end=$TODAY" | |
echo $(curl -s -X GET -H "$HEADER" "$URL" | jq -r '.cummulative_total.digital') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment