Skip to content

Instantly share code, notes, and snippets.

View craigtommola's full-sized avatar

Craig Tommola craigtommola

View GitHub Profile
@craigtommola
craigtommola / code.gs
Last active March 27, 2018 20:49
GAS Sheet: Pitchfork Complex
function doGet() {
var root = XmlService.createElement('CALENDAR');
var CALENDAR = SpreadsheetApp.openById('18S7Jvc5xQE-Bx2yOpLlebIyhTzjyR845lNFHjscV8ss');
var data = CALENDAR.getDataRange().getValues();
for (var i = 1; i < data.length; i++) {
var child = XmlService.createElement('EVENT')
var NAME = XmlService.createElement('NAME')
.setText(data[i][0]);
var LINK = XmlService.createElement('LINK')
@craigtommola
craigtommola / code.gs
Last active March 1, 2018 14:47
GAS Calendar - Pitchfork Basic
function doGet() {
var root = XmlService.createElement('CALENDAR'); // Set variable "root" equal to a new node of our XML structure named CALENDAR
var calendarId = '[email protected]'; // Public calendar we're connecting to
var calendar = CalendarApp.getCalendarById(calendarId); // Connection to Calendar
var calendarName = calendar.getName(); // Set variable "calendarName" equal to the calendar.getName value
var calendarDesc = calendar.getDescription(); // Set variable "calendarDesc" equal to the calendar.getDescription value
var optionalArgs = { // Parameters to filter results. See all parameters at https://bit.ly/GAScal_eventlist
timeMin: (new Date()).toISOSt
@craigtommola
craigtommola / code.gs
Last active February 26, 2018 19:47
Quickstart: GAS Calendar - US Holidays
function doGet() {
var calendarId = 'en.usa#[email protected]'; // Public calendar we're connecting to
var optionalArgs = { // See optionalArgs at http://bit.ly/GAScal_eventlist
timeMin: (new Date()).toISOString(), // Setting today as the minimal time requirement
showDeleted: false, // Only show active events
singleEvents: true, // Return recurring events as individual events
maxResults: 10, // Max of 10 records
orderBy: 'startTime' // Order chronologically
};
var response = Calendar.Events.lis