Skip to content

Instantly share code, notes, and snippets.

@Saturate
Last active March 2, 2022 15:45
Show Gist options
  • Save Saturate/9388053 to your computer and use it in GitHub Desktop.
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.
/*
# 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)
}
);
@Saturate
Copy link
Author

@dorjemrav happy that you could use some old code I forgot about :-) that's the awesome thing with open source. Have a nice summer!

@popeadam
Copy link

popeadam commented Sep 9, 2021

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?

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