-
-
Save Saturate/9388053 to your computer and use it in GitHub Desktop.
/* | |
# 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) | |
} | |
); |
Note I've replaced this line:
var fileid = el.pathname.split('/')[3];
with this one:
var fileid = el.href.match(/\/(\d+)$/)[1];
Thank you for this. Saved me a bunch of time with external yammer communities that are not connected to M365 groups so no sharepoint site to download from.
Thank you for this. Saved me a bunch of time with external yammer communities that are not connected to M365 groups so no sharepoint site to download from.
Glad you could use my old code :)
@Saturate - thanks for this. Cleaning up old Yammer groups now that we have TEAMS.
NOTE for other users
I found that removing the popup.close section of the code was required when downloading over a slow connection, as the popup windows were being closed prior to the download being complete.
Code I used was
[].forEach.call(
document.querySelectorAll('.page-content .yj-tabular-data-name'),
function(el){
var fileid = el.href.match(//(\d+)$/)[1];
var downloadPath = "https://www.yammer.com/api/v1/uploaded_files/"+fileid+"/download";
var popup = window.open(downloadPath);
//I found the download tabs in Chrome closed when the download was complete
}
);
@dorjemrav happy that you could use some old code I forgot about :-) that's the awesome thing with open source. Have a nice summer!
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?
This worked...