-
Notifications
You must be signed in to change notification settings - Fork 0
/
code.gs
36 lines (28 loc) · 913 Bytes
/
code.gs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var ss = SpreadsheetApp.openById('1gcYI826jGG-C5fFl9iq1LBvpnGVTxCuk17LkRd-YYQg');
function doGet(e) {
if("post" in e.parameter){
var content = e.parameter.post;
if (content != undefined){
var sheet = ss.getSheetByName('RECEIVE');
var time = new Date().toLocaleString();
var lr = sheet.getLastRow();
sheet.getRange(lr+1,1).setValue(content);
sheet.getRange(lr+1,2).setValue(time);
}
}
else{
var sheet = ss.getSheetByName('SEND');
content = sheet.getRange('A2:C12').getValues();
return ContentService.createTextOutput(content);
}
}
function doPost(e) {
var content = e.parameter.message;
if (content != undefined){
var sheet = ss.getSheetByName('RECEIVE');
var time = new Date().toLocaleString();
var lr = sheet.getLastRow();
sheet.getRange(lr+1,1).setValue(content);
sheet.getRange(lr+1,2).setValue(time);
}
}