Created
June 11, 2020 08:24
-
-
Save CharlyWargnier/6b3290ccd2c1a05391442b02b5345b86 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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