Skip to content

Instantly share code, notes, and snippets.

@LsTinyBaby
Last active December 24, 2018 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LsTinyBaby/11bf924a4f26fd81947578cb2e91a17b to your computer and use it in GitHub Desktop.
Save LsTinyBaby/11bf924a4f26fd81947578cb2e91a17b to your computer and use it in GitHub Desktop.
RemoveSlackFiles = (function() {
TOKENTOKEN = localStorage.key(localStorage.length - 1).split('_')[0];
UserID = localStorage.key(1).split('_')[0];
Workspace = document.URL.split('//')[1].split('.slack.com')[0];
function DeleteFiles(FileID) {
if (FileID == 'FE28L0UPP' || FileID == 'FEAGSJ00J' || FileID == 'FEV7RJ8BD') {
console.log('Giữ lại file code của bạn Vũ :v')
} else {
fetch('/api/files.delete?token=' + TOKENTOKEN + '&file=' + FileID, {
credentials: 'include',
authority: Workspace + '.slack.com',
method: 'POST',
});
};
};
/*
FE28L0UPP: Remove Slack Files
FEAGSJ00J: DeleteAllPreviousZoomClass
FEV7RJ8BD: CreatSchedule
*/
fetch('/api/files.list?token=' + TOKENTOKEN + '&user=' + UserID, {
authority: Workspace + '.slack.com',
credentials: 'include',
method: 'GET'
}).then(function(Content) {
return Content.text()
}).then(function(List) {
for (var FindID = /"id":"([A-Z0-9]+)"/g, FileID = FindID.exec(List); null != FileID;) {
DeleteFiles(FileID[1]);
FileID = FindID.exec(List);
};
}).then(function() {
window.alert('Done!');
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment