Skip to content

Instantly share code, notes, and snippets.

View RobertLowe's full-sized avatar

Robert Lowe RobertLowe

View GitHub Profile

Keybase proof

I hereby claim:

  • I am RobertLowe on github.
  • I am robertlowe (https://keybase.io/robertlowe) on keybase.
  • I have a public key whose fingerprint is 8872 8828 D334 6AAE F5B0 C12E 3DB6 A5D8 889C D40E

To claim this, I am signing this object:

@RobertLowe
RobertLowe / anti-newsletters.gs
Last active January 8, 2022 18:49
Anti Newsletter Script for Gmail (and Archive)
function processInbox() {
var label = GmailApp.getUserLabelByName("Newsletter");
if(!label){
label = GmailApp.createLabel("Newsletter");
}
// process all recent threads in the Inbox
var threads = GmailApp.search("newer_than:2d -minusimportantthings");
for (var i = 0; i < threads.length; i++) {
// get all messages in a given thread
var messages = threads[i].getMessages();