backedup cin7 templates. Cloned more courses. Domains to csv for anthology was completed. new GAS script for cin7 courses within a google sheet.
This commit is contained in:
1
Scripts/GAS_GS/Cin7-Courses-List/.clasp.json
Normal file
1
Scripts/GAS_GS/Cin7-Courses-List/.clasp.json
Normal file
@ -0,0 +1 @@
|
||||
{"scriptId":"1e5nYT5B2NyD5UQdJvgC9Dh5fBkaF6-BBwD2X26iV-6VwB0bt8OCbMEzY","rootDir":"/Users/normrasmussen/Documents/Work/Scripts/GAS_GS/Cin7-Courses-List"}
|
||||
26
Scripts/GAS_GS/Cin7-Courses-List/PullCourses.js
Normal file
26
Scripts/GAS_GS/Cin7-Courses-List/PullCourses.js
Normal file
@ -0,0 +1,26 @@
|
||||
const apiKey = "51BNlRsLYKQxSu1q1UQq7F63j"
|
||||
|
||||
function getCourses() {
|
||||
let page = 0
|
||||
while (page >= 0) {
|
||||
page++
|
||||
Logger.log(page)
|
||||
var apiURL = 'https://api.northpass.com/v2/courses?limit=100&page='+page;
|
||||
const settings = {
|
||||
async: true,
|
||||
crossDomain: true,
|
||||
method: 'GET',
|
||||
headers: {
|
||||
accept: 'application/json',
|
||||
'X-Api-Key': apiKey
|
||||
}
|
||||
};
|
||||
const sendMsg = UrlFetchApp.fetch(apiURL, settings);
|
||||
var txtResponse = sendMsg.getContentText();
|
||||
var parseProps = JSON.parse(txtResponse);
|
||||
|
||||
if (parseProps["links"]["next"] == null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
7
Scripts/GAS_GS/Cin7-Courses-List/appsscript.json
Normal file
7
Scripts/GAS_GS/Cin7-Courses-List/appsscript.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"timeZone": "America/New_York",
|
||||
"dependencies": {
|
||||
},
|
||||
"exceptionLogging": "STACKDRIVER",
|
||||
"runtimeVersion": "V8"
|
||||
}
|
||||
Reference in New Issue
Block a user