walter1 commited on
Commit
99ce06d
·
1 Parent(s): 63c29f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -3
app.py CHANGED
@@ -38,14 +38,28 @@ def greet(string):
38
  import json
39
  import requests
40
 
41
- spreadsheet_id = '1vjWnYsnGc0J6snT67NVbA-NWSGZ5b0eDBVHmg9lbf9s' # Please set the Spreadsheet ID.
 
42
  body = {
43
  "arguments": {"range": "Sheet1!A"+str(len(df)+2), "valueInputOption": "USER_ENTERED"},
44
  "body": {"values": [[string]]}
45
  }
46
- url = 'https://script.google.com/macros/s/AKfycbwXP5fsDgOXJ9biZQC293o6bTBL3kDOJ07PlmxKjabzdTej6WYdC8Yos6NpDVqAJeVM/exec?spreadsheetId=' + spreadsheet_id
47
  res = requests.post(url, json.dumps(body), headers={'Content-Type': 'application/json'})
48
- print(res.text)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  #######################
50
 
51
  return predicted_label
 
38
  import json
39
  import requests
40
 
41
+ spreadsheet_id = '1vjWnYsnGc0J6snT67NVbA-NWSGZ5b0eDBVHmg9lbf9s' # Please set the Spreadsheet ID.
42
+ url = 'https://script.google.com/macros/s/AKfycbwXP5fsDgOXJ9biZQC293o6bTBL3kDOJ07PlmxKjabzdTej6WYdC8Yos6NpDVqAJeVM/exec?spreadsheetId=' + spreadsheet_id
43
  body = {
44
  "arguments": {"range": "Sheet1!A"+str(len(df)+2), "valueInputOption": "USER_ENTERED"},
45
  "body": {"values": [[string]]}
46
  }
 
47
  res = requests.post(url, json.dumps(body), headers={'Content-Type': 'application/json'})
48
+
49
+ body = {
50
+ "arguments": {"range": "Sheet1!B"+str(len(df)+2), "valueInputOption": "USER_ENTERED"},
51
+ "body": {"values": [[predicted_label]]}
52
+ }
53
+ res = requests.post(url, json.dumps(body), headers={'Content-Type': 'application/json'})
54
+
55
+ import datetime
56
+ current_time = datetime.datetime.now()
57
+ body = {
58
+ "arguments": {"range": "Sheet1!C"+str(len(df)+2), "valueInputOption": "USER_ENTERED"},
59
+ "body": {"values": [[current_time ]]}
60
+ }
61
+ res = requests.post(url, json.dumps(body), headers={'Content-Type': 'application/json'})
62
+ #print(res.text)
63
  #######################
64
 
65
  return predicted_label