Skip to content

Commit 2b77f71

Browse files
committed
add google sheet functionality
1 parent e032da1 commit 2b77f71

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

WorkoutTracking/main.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import datetime
33
import os
44

5-
# nutritionix
5+
# NUTRITIONIX
66
APP_ID = os.environ.get("APP_ID", "APP ID it doesn't exist")
77
API_KEY = os.environ.get("API_KEY", "API_KEY it doesn't exist")
88

@@ -13,7 +13,7 @@
1313
"x-app-key": API_KEY
1414
}
1515

16-
user_input = input("Which exercise you did?")
16+
user_input = input("Which exercise you did? ")
1717

1818
data = {
1919
"query": user_input
@@ -27,13 +27,22 @@
2727
print(f"Error in the request. Status code: {response_nutritionix.status_code}")
2828
print(response_nutritionix.text)
2929

30-
# sheety
31-
url = ""
30+
# SHEETY
31+
SHEETY_API_URL = "https://api.sheety.co/-------------/workoutTracking/workouts"
32+
3233
headers = {
33-
"Authorization": ""
34+
'Authorization': f'Basic ---------'
3435
}
3536

36-
response_sheety = requests.post()
37-
37+
# Mock data
38+
data = {
39+
"workout": {
40+
"date": "28/07/2020",
41+
"time": "10:00:00",
42+
"exercise": "Yoga",
43+
"duration": 60,
44+
"calories": 200
45+
}
46+
}
3847

39-
# Saving data into google sheets
48+
response = requests.post(SHEETY_API_URL, json=data, headers=headers)

0 commit comments

Comments
 (0)