This file contains hidden or 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 zeroCells() { | |
| var ss=SpreadsheetApp.getActiveSpreadsheet(); | |
| var sheet=ss.getSheets()[0]; | |
| var selection=sheet.getDataRange(); | |
| var columns=selection.getNumColumns(); | |
| var rows=selection.getNumRows(); | |
| for (var column=1; column < columns; column++) { | |
| for (var row=1; row < rows; row++) { | |
| var cell=selection.getCell(row,column); | |
| if (cell.isBlank()) { |
This file contains hidden or 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
| /** | |
| * Adds a custom menu to the active spreadsheet, containing a single menu item | |
| * for invoking the exportJSON() function specified above. | |
| * The onOpen() function, when defined, is automatically invoked whenever the | |
| * spreadsheet is opened. | |
| * For more information on using the Spreadsheet API, see | |
| * https://developers.google.com/apps-script/service_spreadsheet | |
| */ | |
| function onOpen() { | |
| var sheet = SpreadsheetApp.getActiveSpreadsheet(); |
This file contains hidden or 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 scheduledCollection(){ | |
| var schedule = []; | |
| // dates/times in mm/dd/yyyy hh:mm - timezone matches settings in File > Project properties | |
| schedule.push({start:"08/29/2012 15:00", end:"08/29/2012 16:00"}); | |
| schedule.push({start:"08/29/2012 20:00", end:"08/29/2012 22:00"}); | |
| checkCollect(schedule); | |
| } | |
| function checkCollect(schedule){ | |
| var now = new Date(); |
This file contains hidden or 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 lastValue(column) { | |
| var parts = column.split("!"); | |
| if (parts.length == 2) { | |
| var sheetName = parts[0]; | |
| var column = parts[1]; | |
| var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName); | |
| } else { | |
| var column = parts[0]; | |
| var sheet = SpreadsheetApp.getActiveSheet(); | |
| } |
This file contains hidden or 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 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; | |
| } |
NewerOlder