Anthology CSV parser updated. Courses & categories for Supplier

This commit is contained in:
Norm Rasmussen
2025-05-19 14:26:29 -04:00
parent 9f7fd92613
commit 4a3ad336a5
2 changed files with 7 additions and 6 deletions

View File

@ -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",