Last active
March 2, 2022 15:45
-
-
Save Saturate/9388053 to your computer and use it in GitHub Desktop.
Download all files in a Yammer.com group. You have to enable popups. Only tested in chrome.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
# How to use: | |
1. Navigate to the files tab (https://www.yammer.com/COMPANY/groups/GROUP/uploaded_files) | |
2. Press F12. | |
3. Paste script in console and run it. | |
4. Enjoy downloading files! | |
# Not working? | |
1. Enable popups | |
2. Try too use chrome | |
*/ | |
var time = 2000; // time before we close the popup again. | |
[].forEach.call( | |
document.querySelectorAll('.page-content .yj-tabular-data-name'), | |
function(el){ | |
var fileid = el.pathname.split('/')[3]; | |
var downloadPath = "https://www.yammer.com/api/v1/uploaded_files/"+fileid+"/download"; | |
var popup = window.open(downloadPath); | |
// Close timout. You can skip this and just close all browser windows if you want. | |
setTimeout(function (argument) { | |
popup.close(); | |
}, time) | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've a community with 700+ files; when I run this script, it times out after the first 50 or so. Can we easily add a short delay to the script so it opens a pop-up every 15 seconds?