This file contains hidden or 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
| // ---------------------------- | |
| // --- GLOBAL CONFIGURATION --- | |
| // ---------------------------- | |
| // Define the list of Gmail folders (labels) to be cleaned. | |
| // To specify a custom label that is nested under another, use a forward slash '/'. | |
| const FOLDERS_TO_CLEAN = ["Trash", "Spam", "My Custom Label"]; // <--- CONFIGURE YOUR FOLDERS HERE | |
| // Define the minimum age (in days) a message must be before it is deleted | |
| // from non-Spam/Trash folders. Messages newer than this will be skipped. | |
| // NOTE: Trash and Spam are always emptied in full, regardless of this setting. |
This file contains hidden or 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
| // | |
| // Trigger function that updates just one cell 'MySheet:$A$1`. | |
| // | |
| // Why? So that it triggers a refresh! | |
| // | |
| // How? Thats the fun part, if you add dependent cells to a | |
| // user formula it causes a refresh. | |
| // | |
| // You can tell the spreadsheet which cells the function is | |
| // dependent on by passing them to the formula at the end of |
This file contains hidden or 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
| /** | |
| * Utility function to remove empty values from an array | |
| * | |
| * @param {array} arr - The array to clean. | |
| * | |
| * @return {array} - An array with no empty values. | |
| **/ | |
| function removeEmptyCells(arr) { | |
| return arr.filter(v => v && v != "") | |
| } |
This file contains hidden or 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
| // | |
| // Helper function that retrieves the JSON data from google finance | |
| // and handles all the error processing involved. | |
| // | |
| function getYahooF(symbol, range="1d") { | |
| const baseUrl = "https://query1.finance.yahoo.com/v8/finance/chart/"; | |
| const maxRetries = 5; // Maximum number of retry attempts | |
| let attempt = 0; | |
| while (attempt < maxRetries) { |