Skip to content

Instantly share code, notes, and snippets.

@nyancodeid
nyancodeid / README.md
Last active May 17, 2024 15:44
Make RESTful API with Google Apps Script and SpreadSheet

Google Script CRUD

By Ryan Aunur Rassyid

Simply create RESTful API with Google Script and store it to Google SpreadSheet like a Pro.

@mesgarpour
mesgarpour / appsScript_ListFilesFolders_ver.2.js
Last active May 31, 2024 22:55
[Google Apps Script] List all files & folders in a Google Drive folder, & write into a speadsheet
/*
* Copyright 2017 Mohsen Mesgarpour
*
* 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
@mogsdad
mogsdad / httpGetTemplate.gs
Created September 9, 2015 02:39
Google Apps Script template functions for external host communication with UrlFetchApp. See https://mogsdad.wordpress.com.
/** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* httpGetTemplate.gs
*
* A pair of template functions for external host communication with
* UrlFetchApp, including parameter encoding and error handling.
*
* From: gist.github.com/mogsdad/a76c32231a2b91ff8b59
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@erickoledadevrel
erickoledadevrel / SendDocument.js
Last active November 30, 2022 12:57
Send a Google Doc in an email using Apps Script
/**
* Sends an email using the contents of a Google Document as the body.
*/
function sendDocument(documentId, recipient, subject) {
var html = convertToHtml(documentId);
html = inlineCss(html);
GmailApp.sendEmail(recipient, subject, null, {
htmlBody: html
});
}
@soundTricker
soundTricker / convertDocs2Html.js
Created February 1, 2013 00:28
Convert Google Docs 2 Html on Google Apps Script GASでGoogle DocumentのファイルをHTMLに変換します。
var KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; //developer key , get from https://code.google.com/apis/console/b/1/
var FILE_ID = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; // drive file id
function convertDocuments2() {
var oauthConfig = UrlFetchApp.addOAuthService('drive');
//Create oauth config for drive api
var scope = 'https://www.googleapis.com/auth/drive';
oauthConfig.setConsumerKey('anonymous');
oauthConfig.setConsumerSecret('anonymous');