Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- traverse(root, callback) {
- console.log("Username: " + creds.user + "Password:" + creds.pass)
- let uri = host+'/rest/api/content/'+root+'/child/page';
- this.getResults(uri, (results) => {
- var recursiveCalls = [];
- this.async.each(results, (page, cb) => {
- recursiveCalls.push(function(callback){
- this.pages.push({
- title: page.title,
- id: page.id
- });
- this.traverse(page.id, cb);
- callback();
- });
- });
- this.async.parallelLimit(recursiveCalls, 4, function(){
- callback(this.pages);
- })
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement