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
var INDEF_LABEL = '#Indef'; | |
var RETENTION_DAYS = 365; | |
var RETENTION_DATE = new Date(); | |
RETENTION_DATE.setDate(RETENTION_DATE.getDate() - RETENTION_DAYS); | |
function DriveIndef() { | |
var root = DriveApp.getRootFolder(); | |
RemoveOldFiles(root); |
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
function GmailIndef() { | |
var INDEF_LABEL = 'Indef'; | |
var RETENTION_DAYS = 356; | |
var RETENTION_DATE = new Date(); | |
RETENTION_DATE.setDate(RETENTION_DATE.getDate() - RETENTION_DAYS); | |
var threads = GmailApp.search('in:anywhere' | |
+ ' -(label:' + INDEF_LABEL + ')' | |
+ ' before:' + RETENTION_DATE.getFullYear() |
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
## Setup | |
# * Create a room with yourself | |
# * Add a Webhook. Click 'Configure Webhook' in dropdown of your room name. Add a webhook and copy the URL. | |
# * Put the webhook URL into <Chat Webhook URL> in the code. Copy the code to | |
# .bashrc | |
## Usage: | |
# ``` | |
# sleep 3; hc | |
# ``` |