Created
November 8, 2018 16:43
-
-
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
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
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