Last active
March 14, 2020 15:06
-
-
Save WouterNieuwerth/c32fbe32d1d1f577e82fd67f81e5599d to your computer and use it in GitHub Desktop.
This file contains 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
// Add your own Cloud Function URL here: | |
var CLOUDFUNCTIONSURL = 'https://europe-west1-cloud-functions-example.cloudfunctions.net/example'; | |
var search_terms = ["buy nike shoes", "adidas online", "rebok cloths"]; // With some spelling errors | |
var brands = ["nike", "adidas", "reebok"]; | |
function main() { | |
var json = { | |
"searchterms": search_terms, | |
"brands": brands | |
}; | |
var options = { | |
method: 'POST', | |
contentType: 'application/json', | |
payload: JSON.stringify(json) | |
}; | |
var response = UrlFetchApp.fetch(CLOUDFUNCTIONSURL, options); | |
Logger.log(response); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment