Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. traverse(root, callback) {
  2. console.log("Username: " + creds.user + "Password:" + creds.pass)
  3. let uri = host+'/rest/api/content/'+root+'/child/page';
  4.  
  5. this.getResults(uri, (results) => {
  6. var recursiveCalls = [];
  7. this.async.each(results, (page, cb) => {
  8. recursiveCalls.push(function(callback){
  9. this.pages.push({
  10. title: page.title,
  11. id: page.id
  12. });
  13. this.traverse(page.id, cb);
  14. callback();
  15. });
  16. });
  17.  
  18. this.async.parallelLimit(recursiveCalls, 4, function(){
  19. callback(this.pages);
  20. })
  21. });
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement