Skip to content

Instantly share code, notes, and snippets.

@brianray
Created June 1, 2019 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianray/1e22237f168e5a1a565891612471a04d to your computer and use it in GitHub Desktop.
Save brianray/1e22237f168e5a1a565891612471a04d to your computer and use it in GitHub Desktop.
function sentiment_analysis(content) {
var URL = "https://us-central1-mw-automl-first-look.cloudfunctions.net/analyze"
var options = {
'method' : 'post',
'contentType': 'application/json',
// Convert the JavaScript object to a JSON string.
'payload' : JSON.stringify({"content": content})
};
return UrlFetchApp.fetch(URL, options).getContentText();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment