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
<?php | |
/* | |
* | |
* Based on (forked from) the work by https://gist.github.com/Kostanos | |
* | |
* This revision allows the PHP file to be included/required in another PHP file and called as a function, rather than focusing on command line usage. | |
* | |
* Convert JSON file to CSV and output it. | |
* | |
* JSON should be an array of objects, dictionaries with simple data structure |
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 createTimeDrivenTriggers() { | |
ScriptApp.newTrigger('listFilesInDrive') //run "listFilesInDrive()" every 5 minutes | |
.timeBased() | |
.everyMinutes(5) //Runs every 5 minutes | |
.create(); | |
}; | |
function listFilesInDrive() { | |
var scriptProperties = PropertiesService.getScriptProperties(); | |
var MAX_FILES = 3; //use a safe value, don't be greedy! |