-
Notifications
You must be signed in to change notification settings - Fork 2
/
fitbit-part1.sh
24 lines (18 loc) · 925 Bytes
/
fitbit-part1.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# ----------------------------------------------------------------------------------
# Fitbit App Configuration
clientid="xxxxxx" # OAuth 2.0 Client ID
clientsecret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # Client Secret
callbackurl="https://mike-greene.com" # Callback URL
# Fitbit Access Token
code="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Fitbit Units
units="en_US"
today=$(date -d "00:00 today" +"%Y-%m-%d") # Today's date, formatted for Fitbit API calls (YYYY-MM-DD)
yesterday=$(date -d "00:00 today" +"%Y-%m-%d") # Yesterday's date, formatted for Fitbit API calls (YYYY-MM-DD)
sevenDaysAgo=$(date -d "00:00 7 days ago" +"%Y-%m-%d") # Seven days ago date, formatted for Fitbit API calls (YYYY-MM-DD)
# Global tags for influxdb
globalTags="platform=Fitbit"
# Path to folder containing this script
cd /var/scripts/fitbit
# ----------------------------------------------------------------------------------