Simon Su presented on Google Apps Script, which allows developers to write scripts that interact with Google services like Gmail, Docs, Sheets and more. He discussed how Apps Script can be used to build service monitors, integrate with Google Forms by sending notifications, and create RESTful APIs. Simon provided code examples for these use cases and discussed other features like connecting to Google Cloud Platform services and the Chrome Web Store.
5. Cloud Changes the Developer
Few years ago
● system and os
● network setup
● install what I need
● mail sdk
● sms bridge
● backup and archive
● socket protocol
● building versioning
system for develop
● ...
Now
● cloud machine
● vpc and permission
● software preload
● email service
● sms service
● object storage
● restful protocal
● git deploy & github
in the world
● ...
10. Apps Script Serves
By Type
● Standalone Scripts
● Container-Bound Scripts
By Function
● Spreadsheet Custom Functions
● Web Apps
● Google Sites Gadgets
● Container Extensions
11. API Supports
● Google Apps
Services
● Calendar
● Contacts
● DocsList
● Document
● Domain
● Drive
●
●
●
●
●
●
●
●
Finance
Forms
Gmail
Groups
Language
Maps
Sites
Spreadsheet
12. What you can do with Apps Script?
Monitor your Web
Google Form integrate
Build a RESTful endpoint
13. First Apps Script Service Monitor using Google Drive
● Idea
○ Using google sheet for data persistance
○ Using apps script UrlFetch to retrieve monitor target
resource
● Some Reference
○ http://gappsnews.blogspot.tw/2013/01/google-appsscript-http-monitor.html
○ http://gappsnews.blogspot.tw/2013/03/re-googlegoogle-apps-scriptgoogle-form.html
14. You will know...
● SpreadsheetApp.openById(...)
○ getSheetByName(...)
○ insertSheet(...)
○ appendRow(...)
● UrlFetchApp.fetch(...)
18. 2nd Apps Script Google Form send notification
● Idea:
○ Send mail notify when form sent
○ Call remote rest when form sent
●
Some References:
○ http://gappsnews.blogspot.tw/2013/03/fwd-googleapps-script-event-object.html
○ http://gappsnews.blogspot.tw/2013/02/google-appsscriptgoogle-form.html
19. You will know...
● SpreadsheetApp.getActiveSheet()
● GmailApp.sendEmail(...)
● JSON
○ Object.keys(jsonObject)
○ JSON.stringify(jsonObject)
○ JSON.parse(string)
25. 3rd Apps Script Build a RESTful Service
● Idea
○ The advance interactive to all clients
● Restrictions
○ base url is fixed, only query and form as patameter
can be the input
○ get, post method only (2013.7.21)
○ need solve the HTTP CODE: 302 problem
● Some Reference
○ http://gappsnews.blogspot.tw/2013/07/apps-scriptwith-restful.html
○ http://gappsnews.blogspot.tw/2013/07/fwd-appsscript.html
○ http://gappsnews.blogspot.tw/2013/07/apps-script-
32. Thinking in different...
● Drive application integrate related,
scheduling, data present and interactive...
● Static page service (Github Page, Cloud
CMS) interactive...
● Mobile devices' remote thin app server, to be
a RDB, NDB, BigQuery... middleware
● The chrome extension server side...
36. Other Features Connect to Google Services
● Google Apps
○ Document extension
○ Simple form services
● Google Cloud Platform
○ BigQuery integrate
○ ScriptDB
● External Services
○ Connect with JDBC