Anthology CSV parser updated. Courses & categories for Supplier
This commit is contained in:
@ -1,14 +1,15 @@
|
||||
const apiKey = '8ALsk8jDOlynEwn8ScMBSnG87';
|
||||
|
||||
function main() {
|
||||
Utilities.sleep(7500);
|
||||
var folder = DriveApp.getFolderById("1hAz7O-eoxFUk4YW7FoHr4uNJmPs7CiV5BjBNTLtMJzXwY0CbpykYgSAkFR5Quy_MPdn3e_5j");
|
||||
var files = folder.getFiles();
|
||||
while (files.hasNext()) {
|
||||
var file = files.next();
|
||||
var getDate = new Date();
|
||||
var date = Utilities.formatDate(getDate, 'America/New_York', 'MM/dd/yyyy hh:mm');
|
||||
var date = Utilities.formatDate(getDate, 'America/New_York', 'MM/dd/yyyy hh');
|
||||
var fileDate = file.getDateCreated();
|
||||
var fileDateFormatted = Utilities.formatDate(fileDate, 'America/New_York', 'MM/dd/yyyy hh:mm');
|
||||
var fileDateFormatted = Utilities.formatDate(fileDate, 'America/New_York', 'MM/dd/yyyy hh');
|
||||
if (date == fileDateFormatted) {
|
||||
Logger.log("Updated: "+file)
|
||||
var updated_file = file.getBlob()
|
||||
@ -34,10 +35,10 @@ function moveOldFiles() {
|
||||
while (files.hasNext()) {
|
||||
var file = files.next();
|
||||
var getDate = new Date();
|
||||
var date = Utilities.formatDate(getDate, 'America/New_York', 'MM/dd/yyyy hh:mm' );
|
||||
var date = Utilities.formatDate(getDate, 'America/New_York', 'MM/dd/yyyy hh' );
|
||||
var fileDate = file.getDateCreated();
|
||||
Logger.log("FILE: "+file+", DATE UPLOADED: "+fileDate)
|
||||
var fileDateFormatted = Utilities.formatDate(fileDate, 'America/New_York', 'MM/dd/yyyy hh:mm');
|
||||
var fileDateFormatted = Utilities.formatDate(fileDate, 'America/New_York', 'MM/dd/yyyy hh');
|
||||
if (date != fileDateFormatted) {
|
||||
const destination = DriveApp.getFolderById('1cIPZCgoj8XdjMIfL75QfomJAxsy2smGT');
|
||||
file.moveTo(destination);
|
||||
@ -144,7 +145,7 @@ function updatedDomainsOnly(domains_to_update) {
|
||||
const dom = array.shift();
|
||||
const groups = array;
|
||||
Logger.log("{domain_to_update : {domain :"+dom+", group_ids : "+groups+" }}")
|
||||
//sendWebhook({domain_to_update : { domain: dom, group_ids: groups }})
|
||||
sendWebhook({domain_to_update : { domain: dom, group_ids: groups }})
|
||||
replaceOnSheet(dom, groups);
|
||||
}
|
||||
MailApp.sendEmail("amitd@anthology.com",
|
||||
|
||||
Reference in New Issue
Block a user