Skip to content

Instantly share code, notes, and snippets.

@amenpunk
Created September 23, 2019 23:44
Show Gist options
  • Save amenpunk/c554b3338a4792a13b1e1cf0157d7634 to your computer and use it in GitHub Desktop.
Save amenpunk/c554b3338a4792a13b1e1cf0157d7634 to your computer and use it in GitHub Desktop.
function doGet(e){
var ss = SpreadsheetApp.openByUrl("¿");
var sheet = ss.getSheetByName("Hoja1");
return insert(e,sheet);
}
function doPost(e){
var ss = SpreadsheetApp.openByUrl("?");
var sheet = ss.getSheetByName("Hoja1");
return insert(e,sheet);
}
function insert(e,sheet) {
var scannedData = e.parameter.sdata;
var d = new Date();
var ctime = d.toLocaleString();
sheet.appendRow([scannedData,ctime]);
return ContentService
.createTextOutput("Success")
.setMimeType(ContentService.MimeType.JAVASCRIPT);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment