Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
*/
// forEach method, could be shipped as part of an Object Literal/Module
var forEach = function (array, callback, scope) {
for (var i = 0; i < array.length; i++) {
callback.call(scope, i, array[i]); // passes back stuff we need
}
};
// Usage:
// optionally change the scope as final parameter too, like ECMA5
var myNodeList = document.querySelectorAll('.page-content .yj-thumbnail-item-link');
forEach(myNodeList, function (index, value) {
var fileid = value.getAttribute("data-id");
var downloadPath = "https://www.yammer.com/api/v1/uploaded_files/"+fileid+"/download";
var popup = window.open(downloadPath);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment