Skip to content

Instantly share code, notes, and snippets.

@Spencer-Easton
Spencer-Easton / exportSpreadsheet.gs
Last active March 21, 2024 00:43
Example on how to export a Google sheet to various formats, includes most PDF options
function exportSpreadsheet() {
//All requests must include id in the path and a format parameter
//https://docs.google.com/spreadsheets/d/{SpreadsheetId}/export
//FORMATS WITH NO ADDITIONAL OPTIONS
//format=xlsx //excel
//format=ods //Open Document Spreadsheet
//format=zip //html zipped
function exampleEdit() {
var email = "15x.moon@email.com";
var sharedCode = "blahdiblah123";
var imageFile = convertSVG(editSVG(email, sharedCode, null), 'This is a PNG with the sharedCode');
// do whatever with the imageFile - I want to add it to an email to send the recipient address above
}
@rcknr
rcknr / gist:3306363
Created August 9, 2012 17:43
Update Twitter avatar with Apps Script
function oAuthConfig() {
var oAuthConfig = UrlFetchApp.addOAuthService("twitter");
oAuthConfig.setAccessTokenUrl("http://api.twitter.com/oauth/access_token");
oAuthConfig.setRequestTokenUrl("http://api.twitter.com/oauth/request_token");
oAuthConfig.setAuthorizationUrl("http://api.twitter.com/oauth/authorize");
// Register an app at https://dev.twitter.com/apps/new to get the following key and secret
oAuthConfig.setConsumerKey("PUT CONSUMER KEY HERE");
oAuthConfig.setConsumerSecret("PUT CONSUMER SECRET HERE");
}