Skip to content

Instantly share code, notes, and snippets.

@siliconvallaeys
Created November 8, 2018 16:43
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 siliconvallaeys/bf7a459b4668fd8831194331ea51af37 to your computer and use it in GitHub Desktop.
Save siliconvallaeys/bf7a459b4668fd8831194331ea51af37 to your computer and use it in GitHub Desktop.
Read data from a public Json data store so you can maintain state between several script runs
function main() {
// Enter your own URI here, the same one you used when writing your data
var MyJsonBin = 'https://api.myjson.com/bins/l46me';
var options = {
method:"get",
};
var response = UrlFetchApp.fetch(MyJsonBin, options);
var tokens = JSON.parse(response.getContentText());
var uri = tokens['uri'];
for(var key in tokens) {
var val = tokens[key];
Logger.log(key + " " + val);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment