Skip to content

Instantly share code, notes, and snippets.

@CharlyWargnier
Created June 11, 2020 08:24
Show Gist options
  • Save CharlyWargnier/6b3290ccd2c1a05391442b02b5345b86 to your computer and use it in GitHub Desktop.
Save CharlyWargnier/6b3290ccd2c1a05391442b02b5345b86 to your computer and use it in GitHub Desktop.
function getSummary(text){
payload = `text=${text}`;
payload = encodeURI(payload);
console.log(payload);
var url = "https://us-central1-hamlet-title-descr-generator.cloudfunctions.net/t5_post";
var options = {
"method" : "POST",
"contentType" : "application/x-www-form-urlencoded",
"payload" : payload,
'muteHttpExceptions': true
};
var response = UrlFetchApp.fetch(url, options);
var result = response.getContentText();
console.log(result);
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment