Tons of anthology work with notes and scripts. Updated DE's tamplates. Small script changes as well.
This commit is contained in:
44
Scripts/clone_courses.js
Normal file
44
Scripts/clone_courses.js
Normal file
@ -0,0 +1,44 @@
|
||||
const pt = require('puppeteer');
|
||||
const readline = require("readline");
|
||||
|
||||
const rl =
|
||||
readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
})
|
||||
var userEmail= 'nrasmussen@northpass.com';
|
||||
var userPassword= 'ecx5pmy!MAN2vgh2knc';
|
||||
var otp = '';
|
||||
var schoolUUID = '52d19519-103f-45e3-9fa8-d21baa0f8aaa';
|
||||
var courseUUIDs =
|
||||
var schoolNameToCloneTo = 'Anthology Internal';
|
||||
|
||||
function wait(ms) {
|
||||
return new Promise(r => setTimeout(r, ms));
|
||||
}
|
||||
|
||||
pt.launch({ headless: false }).then(async browser => {
|
||||
var p = await browser.newPage();
|
||||
await p.setViewport({ width: 1000, height: 500 })
|
||||
await p.goto('https://app.northpass.com/admin/sign_in')
|
||||
await wait(500)
|
||||
await p.type('#administrator_email', userEmail)
|
||||
await p.type('#administrator_password', userPassword)
|
||||
await p.click('input.button');
|
||||
await wait(500)
|
||||
await p.goto('https://app.northpass.com/admin/twofactorauth/edit')
|
||||
await wait(500)
|
||||
await p.type('#otp_otp_attempt',otp)
|
||||
await p.click('input.button');
|
||||
await wait(500)
|
||||
for (var i = 0; i < courseUUIDs.length;i++) {
|
||||
await p.goto('https://app.northpass.com/admin/schools/'+ schoolUUID +'/courses/'+ courseUUIDs[i] +'/clone/new')
|
||||
await p.type('#react-select-2-input',schoolNameToCloneTo)
|
||||
await p.keyboard.press('Enter');
|
||||
await wait(100)
|
||||
await p.click('input.button');
|
||||
await wait(1000)
|
||||
}
|
||||
await wait(2000)
|
||||
await browser.close()
|
||||
})
|
||||
Reference in New Issue
Block a user