http://stackoverflow.com/questions/34801292/how-to-add-a-line-to-a-google-spreadsheet-via-email
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
/** | |
* Reminder script for GMail: A simple Google Apps Script to create a Google Calendar event (reminder) for any mail (with a | |
* specific label). You can then setup ("timed") triggers in Apps Script (hourly, etc) to monitor your Inbox. | |
* How to Use: | |
* 1. Log into Google Drive account and create a Google Script. | |
* 2. Copy and paste the below snippet into the gs file. | |
* 3. Make sure to update the 'reminderLabel', 'calendarName' and 'reminderDuration' as per your preference. | |
* 4. Test the script to make sure it is working properly. | |
* 5. Setup a time-driven Project Trigger (hourly, etc) to automatically run this script and create calendar events. | |
* |
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
/* paste into http://script.google.com | |
run periodically (e.g. every 5 minutes) with a timer by selecting 'Resources' > 'current project's triggers...' | |
*/ | |
function filterLongEmails() { | |
var num_messages = 1; // will be applied to the last n messages. Google allows up to 500 | |
var word_limit = 50; | |
var subj = "Shorter emails will get read."; | |
var body = "Dear friends, I value my time and yours but I appreciate it if you can keep your emails under " + word_limit + " words. Please edit and resend."; | |
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
/* | |
This script watches a gmail account for any thread labeled with 'rtm'. When such a thread is found it | |
sends a task-creation email to Remember the Milk that includes a link back to the original thread. | |
To follow the link back to the email you have to be logged in to the originating Gmail account (which | |
is only an issue if you have multiple gmail accounts). Otherwise Google claims the email cannot be | |
found. | |
To install it go into Google Drive and create a new "Script" (the link is a bit hidden in the create submenu). | |
Copy this code into the new project and set a time-based trigger. |
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
# This script, when used with Google Apps Scripts will delete 500 emails and can be triggered to run every minute without user interaction enabling you to bulk delete email in Gmail without getting the #793 error from Gmail. | |
# Configure the search query in the code below to match the type of emails you want to delete | |
# Browser to https://script.google.com/. | |
# Start a script and paste in the code below. | |
# After you past it in, save it and click the little clock looking button. This is for your triggers. You can set up how frequently you want the script to run (I did mine for every minute). | |
# Source : # https://productforums.google.com/d/msg/gmail/YeQVDuPIQzA/kpZPDDj8TXkJ | |
function batchDeleteEmail() { | |
var batchSize = 100 // Process up to 100 threads at once |
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. |
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 my_teams = ["@github/css", "@github/design"] // Add any teams you want autodetected to this list | |
var base_label = ["GitHub"] | |
var my_teams_regex = new RegExp('(' + my_teams.join('|') + ')') | |
function GitHubThread(thread) { | |
this._thread = thread | |
// Determine why we got this message and label the thread accordingly. | |
// |
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 LABEL = 'Snooze'; | |
var MONTHS = 1; | |
var MARK_UNREAD = true; | |
var ADD_UNSNOOZED_LABEL = true; | |
function dailySnooze() { | |
var today; | |
var page; | |
var d = new Date(); | |
var day = d.getDate(); |
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
// This script retrieves contents of Gmail Inbox and leaves only | |
// predefined amount of last messages. Old messages will be | |
// moved to archive. | |
function cleanOld(){ | |
var old_threads = GmailApp.getInboxThreads(); | |
var leave = 30; | |
if (old_threads.length>=leave){ | |
for (var i=leave; i<old_threads.length; i++){ |
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
// ==UserScript== | |
// @name gmail-enhancer | |
// @namespace gmail-enhancer | |
// @description gmail-enhancer UX experience | |
// @include https://mail.google.com/mail/* | |
// @version 1.2 | |
// @grant none | |
// ==/UserScript== | |
(function() { |