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 doGet(e) { | |
try{ | |
var app = UiApp.createApplication(); | |
var mainPanel = app.createVerticalPanel(); | |
var emailTable = app.createFlexTable().setId("emailTable"); | |
app.add(mainPanel); | |
mainPanel.add(emailTable); | |
var mail = GmailApp.getInboxThreads(0, 10); | |
for (var i = mail.length; i > 0; i--) { | |
var msg = mail[i-1]; |
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
/* | |
* Added Remaining Quota Notifications | |
* Renamed a few menu options | |
* Forked from gist: 1838132 by ligthyear | |
*/ | |
function onOpen() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var menuEntries = [ {name: "Start Mail Merge", functionName: "fnMailMerge"}]; | |
ss.addMenu("Mail Merge", menuEntries); |
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 youtube(){ | |
// Setup OAuthServiceConfig | |
var oAuthConfig = UrlFetchApp.addOAuthService("youtube"); | |
oAuthConfig.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken"); | |
oAuthConfig.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken?scope=http%3A%2F%2Fgdata.youtube.com%2F"); | |
oAuthConfig.setAuthorizationUrl("https://www.google.com/accounts/OAuthAuthorizeToken"); | |
oAuthConfig.setConsumerKey("anonymous"); | |
oAuthConfig.setConsumerSecret("anonymous"); | |
// Setup optional parameters to point request at OAuthConfigService. The "twitter" |
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 makeLinks() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var twitterDataRange = ss.getRangeByName("Twitter3"); | |
vals = twitterDataRange.getValues(); | |
for (i in vals) { | |
var row = vals[i]; | |
for (j in row) { | |
var col = vals[i][j]; | |
vals[i][j] = makeLink(col); |
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 setComments() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var twitterDataRange = ss.getRangeByName("Twitter3"); | |
vals = twitterDataRange.getValues(); | |
for (i in vals) { | |
var row = vals[i]; | |
for (j in row) { | |
var col = vals[i][j]; | |
if (col.length > 0) { |
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 getJSON(aUrl,sheetname) { | |
//var sheetname = "test"; | |
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json"; | |
var response = UrlFetchApp.fetch(aUrl); // get feed | |
var dataAll = Utilities.jsonParse(response.getContentText()); // | |
var data = dataAll.value.items; | |
for (i in data){ | |
data[i].pubDate = new Date(data[i].pubDate); | |
data[i].start = data[i].pubDate; | |
} |
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
/* | |
Copyright 2011 Martin Hawksey | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
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 onOpen() { | |
var menuEntries = [ {name: "Create Diary Doc from Sheet", functionName: "createDocFromSheet"}]; | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
ss.addMenu("Fitness Diaries", menuEntries); | |
} | |
function createDocFromSheet(){ | |
var templateid = "1O4afl8SZmMxMFpAiN16VZIddJDaFdeRBbFyBtJvepwM"; // get template file id | |
var FOLDER_NAME = "Fitness Diaries"; // folder name of where to put completed diaries | |
// get the data from an individual user |
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
// http://goodoldhacking.blogspot.com/2011/01/workaround-for-html-in-apps-script.html | |
/** | |
* Returns a widget formatted with the text. | |
* Modified my mhawksey for inline links | |
*/ | |
function formatTextPanel(a, text) { | |
var app = a ; | |
var panel = app.createFlowPanel(); | |
var lines = text.split("\n"); |
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
// The rest of this code is currently (c) Google Inc. | |
// setRowsData fills in one row of data per object defined in the objects Array. | |
// For every Column, it checks if data objects define a value for it. | |
// Arguments: | |
// - sheet: the Sheet Object where the data will be written | |
// - objects: an Array of Objects, each of which contains data for a row | |
// - optHeadersRange: a Range of cells where the column headers are defined. This | |
// defaults to the entire first row in sheet. | |
// - optFirstDataRowIndex: index of the first row where data should be written. This |
OlderNewer