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
// To load this script, open a Google Sheet (yeah, weird I know), then select "Tools->Script Editor" | |
// From there, past this content into a script. You can set up triggers to run this script every day at a certain time | |
// by selecting Resources -> Triggers. | |
// I recommend you set the trigger to every 5-10 minutes. This will let the batches complete. If the trigger is too infrequent, it wont have time to finish. | |
// https://developers.google.com/apps-script/reference/gmail/ | |
// For large inboxes (the ones you want to analyze) gmail will rate limit you. | |
// They recommend adding a sleep to call less, but then your exec time will be too long. | |
// To solve this, we run in batches. This is the batch size. Decrease this if exec time is too long. |