Last active
December 24, 2018 04:14
-
-
Save LsTinyBaby/11bf924a4f26fd81947578cb2e91a17b to your computer and use it in GitHub Desktop.
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
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