Forked from Saturate/yammer-group-download-all-files.js
Last active
November 28, 2016 18:19
-
-
Save sayar/01d3d4173bd11f7319336c943c9465dc 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 | |
*/ | |
// 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