Skip to content

Instantly share code, notes, and snippets.

@Ryanb58
Last active September 25, 2023 23:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Ryanb58/3caef5686082d57b90a4de81416f8f2a to your computer and use it in GitHub Desktop.
Save Ryanb58/3caef5686082d57b90a4de81416f8f2a to your computer and use it in GitHub Desktop.
Jive Document and Content Downloader

Jive document and blog post downloader.

Resulting file will be of PDF format.

  1. Login to Jive

  2. Hover your mouse over your profile photo in the top right corner and select "Your Content" from the dropdown list.

  3. Select the Details View in the top right pane.

  4. Open the "developer tools" by pressing F12.

  5. Navigate to the console tab in the developer tools.

  6. Copy and Paste the script below and press enter.

  • A prompt to download multiple files may appear in the top left of google chrome. Accept the prompt to continue.
var $ = jQuery;
var items = $(".j-browse-details-tbody tr td.j-td-title div");

// Source: https://muaz-khan.blogspot.fr/2012/10/save-files-on-disk-using-javascript-or.html
function SaveToDisk(fileURL, fileName) {

  var save = document.createElement('a');
  save.href = fileURL;
  save.target = '_blank';
  save.download = fileName || fileURL;
  var evt = document.createEvent('MouseEvents');
  evt.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0,
      false, false, false, false, 0, null);
  save.dispatchEvent(evt);
  (window.URL || window.webkitURL).revokeObjectURL(save.href);

}

items.each(function(i, element) {
  var link = $(element).children("a:first").attr('href');
  if (link.startsWith("/docs/") || link.startsWith("/community/")) {
    var full_url = window.location.protocol + "//" + window.location.hostname + link + ".pdf";
    console.log(full_url);
    SaveToDisk(full_url);
  }
});
  1. Select the next page if there is one.

  2. repeat steps 6-8 until no more pages exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment