Skip to content

Instantly share code, notes, and snippets.

View arran4's full-sized avatar

Arran Ubels arran4

View GitHub Profile
@arran4
arran4 / listAllSharedGoogleDocs.gs
Last active July 29, 2022 18:43 — forked from Diana-Pham/listAllFileDetails.gs
A script to list all your shared files in google drive and with whom it's shared (forked.)
// Run this function to start! You will get an email after a while. ATM it runs at a rate of 20 files every 5 minutes, then it should email you when done. This can be a long time later depending on how many files you have.
function createTimeDrivenTriggers() {
var scriptProperties = PropertiesService.getScriptProperties();
scriptProperties.setProperty("EMAIL", Session.getActiveUser().getEmail());
ScriptApp.newTrigger('listFilesInDrive') //run "listFilesInDrive()" every 5 minutes
.timeBased()
.everyMinutes(5) //Runs every 5 minutes
.create();
};
Call with:
String date = getDate();
String md5 = getMD5("passwprd", date);
checkauth(date, md5, email);
Code:
public class AuthHttpHandler {
private String URI_GET_AUTH = "http://melfridinbot.appspot.com/mobile/checkauth";
protected void authRequest(String mobilePassword, String userEmail) throws NoSuchAlgorithmException, IOException {
HttpClient client = new DefaultHttpClient();
HttpGet getRequest = new HttpGet(URI_GET_AUTH);
getRequest.addHeader("token", getMD5(mobilePassword));
getRequest.addHeader("tokenDate", getDate());