Skip to content

Instantly share code, notes, and snippets.

@andrewgl504
andrewgl504 / gist:d342ba11b17ebee08e12
Last active Aug 29, 2015 — forked from mhawksey/gist:1442370
Google Apps Script to read JSON and write to sheet
View gist:d342ba11b17ebee08e12
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}
You can’t perform that action at this time.