Spaces:
Sleeping
Sleeping
Update google,py
Browse files
google,py
CHANGED
|
@@ -28,13 +28,15 @@ def send_data_to_google_sheets(sheet_name):
|
|
| 28 |
# URL для отправки данных
|
| 29 |
url = f'https://sheets.googleapis.com/v4/spreadsheets/{spreadsheet_id}/values/{sheet_name}:append?valueInputOption=RAW&key={api_key_goo}'
|
| 30 |
|
| 31 |
-
#
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
| 34 |
}
|
| 35 |
|
| 36 |
# Отправка запроса
|
| 37 |
-
response = requests.post(url,
|
| 38 |
|
| 39 |
# Проверка статуса ответа
|
| 40 |
if response.status_code == 200:
|
|
|
|
| 28 |
# URL для отправки данных
|
| 29 |
url = f'https://sheets.googleapis.com/v4/spreadsheets/{spreadsheet_id}/values/{sheet_name}:append?valueInputOption=RAW&key={api_key_goo}'
|
| 30 |
|
| 31 |
+
# Формирование тела запроса
|
| 32 |
+
data = {
|
| 33 |
+
"range": f"{sheet_name}!A:E", # Укажите диапазон ячеек, в которые вы хотите добавить данные
|
| 34 |
+
"majorDimension": "ROWS",
|
| 35 |
+
"values": new_values
|
| 36 |
}
|
| 37 |
|
| 38 |
# Отправка запроса
|
| 39 |
+
response = requests.post(url, json=data)
|
| 40 |
|
| 41 |
# Проверка статуса ответа
|
| 42 |
if response.status_code == 200:
|